diff --git a/src/viewmodels/AccountSetupViewModel.ts b/src/viewmodels/AccountSetupViewModel.ts index aa76de7c559ec0b3f8e324cd4b4b49a4b99541e1..3e83fa81dbc212e099b00b4c94e0439108417ea7 100644 --- a/src/viewmodels/AccountSetupViewModel.ts +++ b/src/viewmodels/AccountSetupViewModel.ts @@ -109,4 +109,8 @@ export class AccountSetupViewModel extends ViewModel { get privacyPolicyLink() { return this._privacyPolicyLink; } + + get footerViewModel() { + return this.options.footerVM; + } } diff --git a/src/viewmodels/ChatterboxViewModel.ts b/src/viewmodels/ChatterboxViewModel.ts index 05844c7e74671146bac4ac4b946455bcf031bd6c..2698e74e9a6bc5a145f61ce25990b06ce98fc58b 100644 --- a/src/viewmodels/ChatterboxViewModel.ts +++ b/src/viewmodels/ChatterboxViewModel.ts @@ -119,4 +119,8 @@ export class ChatterboxViewModel extends ViewModel { private get _session() { return this._client.session; } + + get footerViewModel() { + return this.options.footerVM; + } } diff --git a/src/viewmodels/RootViewModel.ts b/src/viewmodels/RootViewModel.ts index 82e515ccbde432136c005c35f9135fc601bb8cae..a904c333f2329438edcbb07ea6ec92df9b5e1d7b 100644 --- a/src/viewmodels/RootViewModel.ts +++ b/src/viewmodels/RootViewModel.ts @@ -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");