This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/plugins/chat/assets/javascripts/discourse/services/full-page-chat.js
Joffrey JAFFEUX 7fca07821b
FIX: simplfies previous route handling (#18895)
This commits makes sure we correctly wait for the end of the transition to reopen the drawer on the correct channel/view. Also fixes a bug when previous URL was `/` and causing a double transition.
2022-11-07 14:48:18 +01:00

21 lines
354 B
JavaScript

import Service from "@ember/service";
export default class FullPageChat extends Service {
_previousURL = null;
_isActive = false;
enter(previousURL) {
this._previousURL = previousURL;
this._isActive = true;
}
exit() {
this._isActive = false;
return this._previousURL;
}
get isActive() {
return this._isActive;
}
}