mattermost-mobile/app/store/ephemeral_store.js
Elias Nahum 7b75868101 Various fixes (#3078)
* MM-17588 Remove navigation component from stack

* MM-175986 Fix Clock Display Settings on iOS

* Fix markdown and team icon currentServerUrl

* Fix closing permalink logs out the user

* Fix file attachment document ref

* Fix applyTheme when changing a theme in the app

* Feedback review

* remove / when fetching the image on the markdown table on relative paths
2019-08-08 22:39:27 +08:00

32 lines
1 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
class EphemeralStore {
constructor() {
this.appStarted = false;
this.appStartedFromPushNotification = false;
this.deviceToken = null;
this.navigationComponentIdStack = [];
}
getNavigationTopComponentId = () => this.navigationComponentIdStack[0];
getNavigationComponentIds = () => this.navigationComponentIdStack;
addNavigationComponentId = (componentId) => {
const index = this.navigationComponentIdStack.indexOf(componentId);
if (index > 0) {
this.navigationComponentIdStack.slice(index, 1);
}
this.navigationComponentIdStack.unshift(componentId);
};
removeNavigationComponentId = (componentId) => {
const index = this.navigationComponentIdStack.indexOf(componentId);
if (index >= 0) {
this.navigationComponentIdStack.splice(index, 1);
}
}
}
export default new EphemeralStore();