* Update websockets to allow joining document-based rooms * dynamic websocket joining * emit user.join/leave events when entering and exiting document rooms * presence storage * feat: frontend presence store * lint * UI updates * First pass editing state * refactoring * Timeout per user/doc lint * Document data loading refactor to keep Socket mounted * restore: Mark as viewed functionality Add display of 'you' to collaborators * fix: Socket/document remount when document slug changes due to title change * Revert unneccessary package update * Move editing ping interval to a shared constant * fix: Flash of sidebar when loading page directly on editing mode * separate document and revision loading * add comments for socket events * fix: Socket events getting bound multiple times on reconnect * fix: Clear client side presence state on disconnect * fix: Don't ignore server side error Improved documentation * More comments / why comments * rename Socket -> SocketPresence * fix: Handle redis is down remove unneccessary join * fix: PR feedback
69 lines
2.2 KiB
JavaScript
69 lines
2.2 KiB
JavaScript
// @flow
|
|
import ApiKeysStore from './ApiKeysStore';
|
|
import AuthStore from './AuthStore';
|
|
import CollectionsStore from './CollectionsStore';
|
|
import DocumentsStore from './DocumentsStore';
|
|
import EventsStore from './EventsStore';
|
|
import IntegrationsStore from './IntegrationsStore';
|
|
import MembershipsStore from './MembershipsStore';
|
|
import NotificationSettingsStore from './NotificationSettingsStore';
|
|
import DocumentPresenceStore from './DocumentPresenceStore';
|
|
import PoliciesStore from './PoliciesStore';
|
|
import RevisionsStore from './RevisionsStore';
|
|
import SharesStore from './SharesStore';
|
|
import UiStore from './UiStore';
|
|
import UsersStore from './UsersStore';
|
|
import ViewsStore from './ViewsStore';
|
|
|
|
export default class RootStore {
|
|
apiKeys: ApiKeysStore;
|
|
auth: AuthStore;
|
|
collections: CollectionsStore;
|
|
documents: DocumentsStore;
|
|
events: EventsStore;
|
|
integrations: IntegrationsStore;
|
|
memberships: MembershipsStore;
|
|
notificationSettings: NotificationSettingsStore;
|
|
presence: DocumentPresenceStore;
|
|
policies: PoliciesStore;
|
|
revisions: RevisionsStore;
|
|
shares: SharesStore;
|
|
ui: UiStore;
|
|
users: UsersStore;
|
|
views: ViewsStore;
|
|
|
|
constructor() {
|
|
this.apiKeys = new ApiKeysStore(this);
|
|
this.auth = new AuthStore(this);
|
|
this.collections = new CollectionsStore(this);
|
|
this.documents = new DocumentsStore(this);
|
|
this.events = new EventsStore(this);
|
|
this.integrations = new IntegrationsStore(this);
|
|
this.memberships = new MembershipsStore(this);
|
|
this.notificationSettings = new NotificationSettingsStore(this);
|
|
this.presence = new DocumentPresenceStore();
|
|
this.policies = new PoliciesStore(this);
|
|
this.revisions = new RevisionsStore(this);
|
|
this.shares = new SharesStore(this);
|
|
this.ui = new UiStore();
|
|
this.users = new UsersStore(this);
|
|
this.views = new ViewsStore(this);
|
|
}
|
|
|
|
logout() {
|
|
this.apiKeys.clear();
|
|
this.collections.clear();
|
|
this.documents.clear();
|
|
this.events.clear();
|
|
this.integrations.clear();
|
|
this.memberships.clear();
|
|
this.notificationSettings.clear();
|
|
this.presence.clear();
|
|
this.policies.clear();
|
|
this.revisions.clear();
|
|
this.shares.clear();
|
|
this.users.clear();
|
|
this.views.clear();
|
|
}
|
|
}
|