horrible bad code

This commit is contained in:
ThatOneCalculator 2022-11-07 12:09:30 -08:00
parent fc2070c340
commit 144c27298d
2 changed files with 11 additions and 16 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "calckey", "name": "calckey",
"version": "12.119.0-calc.9.16", "version": "12.119.0-calc.9.17",
"codename": "aqua", "codename": "aqua",
"repository": { "repository": {
"type": "git", "type": "git",

View file

@ -65,10 +65,7 @@
<div <div
v-if="widgetsShowing" v-if="widgetsShowing"
class="widgetsDrawer-back _modalBg" class="widgetsDrawer-back _modalBg"
@click="widgetsShowing = false" @click="widgetsShowing = false"let
@touchstart.passive="widgetsShowing = false"
></div>
</transition>
<transition :name="$store.state.animation ? 'widgetsDrawer' : ''"> <transition :name="$store.state.animation ? 'widgetsDrawer' : ''">
<XWidgets v-if="widgetsShowing" class="widgetsDrawer"/> <XWidgets v-if="widgetsShowing" class="widgetsDrawer"/>
@ -107,7 +104,8 @@ window.addEventListener('resize', () => {
isMobile.value = deviceKind === 'smartphone' || window.innerWidth <= MOBILE_THRESHOLD; isMobile.value = deviceKind === 'smartphone' || window.innerWidth <= MOBILE_THRESHOLD;
}); });
let buttonAnimIndex = ref(0); const buttonAnimIndex = ref(0);
const drawerMenuShowing = ref(false);
let pageMetadata = $ref<null | ComputedRef<PageMetadata>>(); let pageMetadata = $ref<null | ComputedRef<PageMetadata>>();
const widgetsEl = $ref<HTMLElement>(); const widgetsEl = $ref<HTMLElement>();
@ -131,27 +129,24 @@ const menuIndicated = computed(() => {
}); });
function updateButtonState(): void { function updateButtonState(): void {
let routerState = window.location.href; let routerState = window.location.pathname;
let secondaryRouterState = mainRouter.currentRoute.value.name; if (routerState === '/') {
if (secondaryRouterState != null && secondaryRouterState === 'index') {
buttonAnimIndex.value = 0; buttonAnimIndex.value = 0;
return; return;
} }
if (routerState.includes('notifications')) { if (routerState.includes('/my/notifications')) {
buttonAnimIndex.value = 1; buttonAnimIndex.value = 1;
return;
} }
else if (routerState.includes('messaging')) { if (routerState.includes('/my/messaging')) {
buttonAnimIndex.value = 2; buttonAnimIndex.value = 2;
return;
} }
else { buttonAnimIndex.value = 3;
buttonAnimIndex.value = 3;
}
} }
updateButtonState(); updateButtonState();
const drawerMenuShowing = ref(false);
mainRouter.on('change', () => { mainRouter.on('change', () => {
drawerMenuShowing.value = false; drawerMenuShowing.value = false;
updateButtonState(); updateButtonState();