Changes to match other timelines in 2.0

This commit is contained in:
Matthew Walsh 2017-10-22 18:45:35 -07:00
parent 3db80f75a6
commit a76b024228
3 changed files with 9 additions and 1 deletions

View file

@ -8,6 +8,7 @@ import {
refreshHomeTimeline, refreshHomeTimeline,
refreshCommunityTimeline, refreshCommunityTimeline,
refreshPublicTimeline, refreshPublicTimeline,
refreshDirectTimeline,
} from './timelines'; } from './timelines';
export const COMPOSE_CHANGE = 'COMPOSE_CHANGE'; export const COMPOSE_CHANGE = 'COMPOSE_CHANGE';
@ -129,7 +130,7 @@ export function submitCompose() {
insertOrRefresh('community', refreshCommunityTimeline); insertOrRefresh('community', refreshCommunityTimeline);
insertOrRefresh('public', refreshPublicTimeline); insertOrRefresh('public', refreshPublicTimeline);
} else if (response.data.visibility === 'direct') { } else if (response.data.visibility === 'direct') {
dispatch(updateTimeline('direct', { ...response.data })); insertOrRefresh('direct', refreshDirectTimeline);
} }
}).catch(function (error) { }).catch(function (error) {
dispatch(submitComposeFail(error)); dispatch(submitComposeFail(error));

View file

@ -67,6 +67,7 @@ const keyMap = {
goToNotifications: 'g n', goToNotifications: 'g n',
goToLocal: 'g l', goToLocal: 'g l',
goToFederated: 'g t', goToFederated: 'g t',
goToDirect: 'g d',
goToStart: 'g s', goToStart: 'g s',
goToFavourites: 'g f', goToFavourites: 'g f',
goToPinned: 'g p', goToPinned: 'g p',
@ -293,6 +294,10 @@ export default class UI extends React.Component {
this.context.router.history.push('/timelines/public'); this.context.router.history.push('/timelines/public');
} }
handleHotkeyGoToDirect = () => {
this.context.router.history.push('/timelines/direct');
}
handleHotkeyGoToStart = () => { handleHotkeyGoToStart = () => {
this.context.router.history.push('/getting-started'); this.context.router.history.push('/getting-started');
} }
@ -331,6 +336,7 @@ export default class UI extends React.Component {
goToNotifications: this.handleHotkeyGoToNotifications, goToNotifications: this.handleHotkeyGoToNotifications,
goToLocal: this.handleHotkeyGoToLocal, goToLocal: this.handleHotkeyGoToLocal,
goToFederated: this.handleHotkeyGoToFederated, goToFederated: this.handleHotkeyGoToFederated,
goToDirect: this.handleHotkeyGoToDirect,
goToStart: this.handleHotkeyGoToStart, goToStart: this.handleHotkeyGoToStart,
goToFavourites: this.handleHotkeyGoToFavourites, goToFavourites: this.handleHotkeyGoToFavourites,
goToPinned: this.handleHotkeyGoToPinned, goToPinned: this.handleHotkeyGoToPinned,

View file

@ -5,6 +5,7 @@
%link{ href: asset_pack_path('features/notifications.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/ %link{ href: asset_pack_path('features/notifications.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
%link{ href: asset_pack_path('features/community_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/ %link{ href: asset_pack_path('features/community_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
%link{ href: asset_pack_path('features/public_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/ %link{ href: asset_pack_path('features/public_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
%link{ href: asset_pack_path('features/direct_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
%meta{name: 'applicationServerKey', content: Rails.configuration.x.vapid_public_key} %meta{name: 'applicationServerKey', content: Rails.configuration.x.vapid_public_key}
%script#initial-state{ type: 'application/json' }!= json_escape(@initial_state_json) %script#initial-state{ type: 'application/json' }!= json_escape(@initial_state_json)