Skip to content
Snippets Groups Projects
Commit 6d67677d authored by RMidhunSuresh's avatar RMidhunSuresh
Browse files

Create and pass footer vm to everywhere needed

parent 2756ba68
No related branches found
No related tags found
No related merge requests found
......@@ -109,4 +109,8 @@ export class AccountSetupViewModel extends ViewModel {
get privacyPolicyLink() {
return this._privacyPolicyLink;
}
get footerViewModel() {
return this.options.footerVM;
}
}
......@@ -119,4 +119,8 @@ export class ChatterboxViewModel extends ViewModel {
private get _session() {
return this._client.session;
}
get footerViewModel() {
return this.options.footerVM;
}
}
......@@ -3,6 +3,7 @@ import { IChatterboxConfig } from "../types/IChatterboxConfig";
import { ChatterboxViewModel } from "./ChatterboxViewModel";
import "hydrogen-view-sdk/style.css";
import { AccountSetupViewModel } from "./AccountSetupViewModel";
import { FooterViewModel } from "./FooterViewModel";
import { MessageFromParent } from "../observables/MessageFromParent";
type Options = { platform: typeof Platform, navigation: typeof Navigation, urlCreator: ReturnType<typeof createRouter>, startMinimized: boolean };
......@@ -16,12 +17,14 @@ export class RootViewModel extends ViewModel {
private _messageFromParent: MessageFromParent = new MessageFromParent();
private _startMinimized: boolean;
private _isWatchingNotificationCount: boolean;
private _footerViewModel: FooterViewModel;
constructor(config: IChatterboxConfig, options: Options) {
super(options);
this._startMinimized = options.startMinimized;
this._config = config;
this._client = new Client(this.platform);
this._footerViewModel = new FooterViewModel(this.childOptions({ config: this._config }));
this._setupNavigation();
this._messageFromParent.on("maximize", () => this.start());
// Chatterbox can be minimized via the start button on the parent page!
......@@ -60,6 +63,7 @@ export class RootViewModel extends ViewModel {
client: this._client,
config: this._config,
state: this._state,
footerVM: this._footerViewModel,
loginPromise,
})
));
......@@ -79,6 +83,7 @@ export class RootViewModel extends ViewModel {
client: this._client,
config: this._config,
state: this._state,
footerVM: this._footerViewModel,
})
));
this.emitChange("activeSection");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment