Merge branch 'develop' of github.com:thecodingmachine/workadventure into iframeMenuScript
This commit is contained in:
commit
833c15b2d5
9 changed files with 29 additions and 19 deletions
|
@ -8,11 +8,9 @@
|
|||
import ContactSubMenu from "./ContactSubMenu.svelte";
|
||||
import CustomSubMenu from "./CustomSubMenu.svelte"
|
||||
import {customMenuIframe, menuVisiblilityStore, SubMenusInterface, subMenusStore} from "../../Stores/MenuStore";
|
||||
import {userIsAdminStore} from "../../Stores/GameStore";
|
||||
import {onDestroy, onMount} from "svelte";
|
||||
import {get, Unsubscriber} from "svelte/store";
|
||||
import {sendMenuClickedEvent} from "../../Api/iframe/Ui/MenuItem";
|
||||
import {CONTACT_URL} from "../../Enum/EnvironmentVariable";
|
||||
|
||||
let activeSubMenu: string = SubMenusInterface.settings;
|
||||
let activeComponent: typeof SettingsSubMenu | typeof CustomSubMenu = SettingsSubMenu;
|
||||
|
@ -20,14 +18,6 @@
|
|||
let unsubscriberSubMenuStore: Unsubscriber;
|
||||
|
||||
onMount(() => {
|
||||
if(!get(userIsAdminStore)) {
|
||||
subMenusStore.removeMenu(SubMenusInterface.globalMessages);
|
||||
}
|
||||
|
||||
if(CONTACT_URL === undefined) {
|
||||
subMenusStore.removeMenu(SubMenusInterface.contact);
|
||||
}
|
||||
|
||||
unsubscriberSubMenuStore = subMenusStore.subscribe(() => {
|
||||
if(!get(subMenusStore).includes(activeSubMenu)) {
|
||||
switchMenu(SubMenusInterface.settings);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue