Skip to content

Commit

Permalink
Fixed small bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekEagle authored Dec 12, 2023
1 parent da8e8e9 commit 3b3f234
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 52 deletions.
2 changes: 0 additions & 2 deletions src/views/staff-space/SetupGuide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,7 @@
import Online from '@/components/Online.vue';
// In-House Modules
import Cumulonimbus from 'cumulonimbus-wrapper';
import backWithFallback from '@/utils/routerBackWithFallback';
import defaultErrorHandler from '@/utils/defaultErrorHandler';
import infoIcon from '@/assets/images/info.svg';
import plusIcon from '@/assets/images/plus.svg';
import toDateString from '@/utils/toDateString';
Expand Down
20 changes: 4 additions & 16 deletions src/views/staff-space/SetupGuides.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
import { ref, watch, onMounted } from 'vue';
import { useOnline } from '@vueuse/core';
import { useRouter } from 'vue-router';
import loadWhenOnline from '@/utils/loadWhenOnline';
const online = useOnline(),
router = useRouter(),
Expand Down Expand Up @@ -161,22 +162,9 @@
}
}
onMounted(async () => {
if (!online.value) {
const unwatchOnline = watch(online, () => {
if (online.value) {
if (!instructions.data || instructions.page !== page.value) {
fetchInstructions();
}
unwatchOnline();
}
});
return;
}
if (!instructions.data || instructions.page !== page.value) {
fetchInstructions();
}
});
onMounted(async () =>
loadWhenOnline(fetchInstructions, !instructions.data || instructions.page !== page.value)
);
function onInstructionClick(instruction: Cumulonimbus.Data.Instruction) {
if (selecting.value) {
Expand Down
30 changes: 5 additions & 25 deletions src/views/staff-space/User.vue
Original file line number Diff line number Diff line change
Expand Up @@ -392,20 +392,19 @@
import Separator from '@/components/Separator.vue';
// In-House Modules
import Cumulonimbus from 'cumulonimbus-wrapper';
import backWithFallback from '@/utils/routerBackWithFallback';
import defaultErrorHandler from '@/utils/defaultErrorHandler';
import fileIcon from '@/assets/images/file.svg';
import gearIcon from '@/assets/images/gear.svg';
import toDateString from '@/utils/toDateString';
import loadWhenOnline from '@/utils/loadWhenOnline';
// Store Modules
import { otherUserStore } from '@/stores/staff-space/user';
import { toastStore } from '@/stores/toast';
import { usersStore } from '@/stores/staff-space/users';
// External Modules
import { ref, onMounted, watch } from 'vue';
import { ref, onMounted } from 'vue';
import { useOnline } from '@vueuse/core';
import { useRouter } from 'vue-router';
Expand All @@ -426,28 +425,9 @@
deleteUserFilesModal = ref<typeof ConfirmModal>(),
deleteUserModal = ref<typeof ConfirmModal>();
onMounted(async () => {
if (!online.value) {
const unwatchOnline = watch(online, () => {
if (online.value) {
if (
!otherUser.data ||
otherUser.data.id !== router.currentRoute.value.query.id
) {
fetchUser();
}
unwatchOnline();
}
});
return;
}
if (
!otherUser.data ||
otherUser.data.id !== router.currentRoute.value.query.id
) {
fetchUser();
}
});
onMounted(async () =>
loadWhenOnline(fetchUser, !otherUser.data ||
otherUser.data.id !== router.currentRoute.value.query.id));
async function fetchUser() {
if (!online.value) {
Expand Down
1 change: 0 additions & 1 deletion src/views/staff-space/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
// In-House Modules
import Cumulonimbus from 'cumulonimbus-wrapper';
import defaultErrorHandler from '@/utils/defaultErrorHandler';
import profileIcon from '@/assets/images/profile.svg';
// Store Modules
Expand Down
3 changes: 1 addition & 2 deletions src/views/user-space/File.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@
onMounted(() =>
loadWhenOnline(
fetchFile,
!file.data,
file.data?.id !== router.currentRoute.value.query.id,
!file.data || file.data?.id !== router.currentRoute.value.query.id,
),
);
Expand Down
5 changes: 1 addition & 4 deletions src/views/user-space/SetupGuide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
// Store Modules
import { instructionStore } from '@/stores/user-space/instruction';
import { instructionsStore } from '@/stores/user-space/instructions';
import { toastStore } from '@/stores/toast';
import { userStore } from '@/stores/user';
Expand All @@ -98,7 +97,6 @@
};
const instruction = instructionStore(),
instructions = instructionsStore(),
user = userStore(),
toast = toastStore(),
router = useRouter(),
Expand Down Expand Up @@ -137,8 +135,7 @@
loadWhenOnline(
fetchInstruction,
!instruction.data,
instruction.data?.name !== router.currentRoute.value.query.id,
!instruction.data || instruction.data?.name !== router.currentRoute.value.query.id,
);
});
Expand Down
2 changes: 0 additions & 2 deletions src/views/user-space/SetupGuides.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@
// External Modules
import { ref, onMounted } from 'vue';
import { useOnline } from '@vueuse/core';
import { useRouter } from 'vue-router';
const instructions = instructionsStore(),
toast = toastStore(),
router = useRouter(),
online = useOnline(),
page = ref(0);
Expand Down

0 comments on commit 3b3f234

Please sign in to comment.