Skip to content

Commit

Permalink
reactivity added to all images
Browse files Browse the repository at this point in the history
  • Loading branch information
zurdi15 committed Jun 27, 2024
1 parent d3324b6 commit 9a86df5
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function closeDialog() {
<v-img
:src="
user.avatar_path
? `/assets/romm/assets/${user.avatar_path}`
? `/assets/romm/assets/${user.avatar_path}?ts=${user.updated_at}`
: defaultAvatarPath
"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function closeDialog() {
imagePreviewUrl
? imagePreviewUrl
: user.avatar_path
? `/assets/romm/assets/${user.avatar_path}`
? `/assets/romm/assets/${user.avatar_path}?ts=${user.updated_at}`
: defaultAvatarPath
"
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Administration/Users/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ onMounted(() => {
<v-img
:src="
item.avatar_path
? `/assets/romm/assets/${item.avatar_path}`
? `/assets/romm/assets/${item.avatar_path}?ts=${item.updated_at}`
: defaultAvatarPath
"
/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/common/Game/Dialog/DeleteRom.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import RAvatar from "@/components/common/Game/Avatar.vue";
import RAvatar from "@/components/common/Game/RAvatar.vue";
import RDialog from "@/components/common/RDialog.vue";
import romApi from "@/services/api/rom";
import storeRoms, { type SimpleRom } from "@/stores/roms";
Expand Down Expand Up @@ -130,7 +130,7 @@ function closeDialog() {
!item.igdb_id && !item.moby_id
? `/assets/default/cover/small_${theme.global.name.value}_unmatched.png`
: item.has_cover
? `/assets/romm/resources/${item.path_cover_s}`
? `/assets/romm/resources/${item.path_cover_s}?ts=${item.updated_at}`
: `/assets/default/cover/small_${theme.global.name.value}_missing_cover.png`
"
/>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/common/Game/Dialog/EditRom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ async function updateRom() {
color: "green",
});
romsStore.update(data);
emitter?.emit("refreshView", null);
})
.catch((error) => {
console.log(error);
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/common/Game/Dialog/MatchRom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ async function updateRom(selectedRom: SearchRomSchema) {
color: "green",
});
romsStore.update(data);
emitter?.emit("refreshView", null);
})
.catch((error) => {
emitter?.emit("snackbarShow", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ async function updateCover(url_cover: string) {
color: "green",
});
romsStore.update(data);
emitter?.emit("refreshView", null);
})
.catch((error) => {
emitter?.emit("snackbarShow", {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/common/Game/Table.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import AdminMenu from "@/components/common/Game/AdminMenu.vue";
import RAvatar from "@/components/common/Game/Avatar.vue";
import RAvatar from "@/components/common/Game/RAvatar.vue";
import romApi from "@/services/api/rom";
import storeAuth from "@/stores/auth";
import storeDownload from "@/stores/download";
Expand Down Expand Up @@ -125,7 +125,7 @@ onMounted(() => {
(!item.igdb_id && !item.moby_id) && !item.has_cover
? `/assets/default/cover/small_${theme.global.name.value}_unmatched.png`
: item.has_cover
? `/assets/romm/resources/${item.path_cover_s}`
? `/assets/romm/resources/${item.path_cover_s}?ts=${item.updated_at}`
: `/assets/default/cover/small_${theme.global.name.value}_missing_cover.png`
"
/>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/types/emitter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export type Events = {
toggleDrawerRail: null;
snackbarShow: SnackbarStatus;
refreshDrawer: null;
refreshView: null;
showLoadingDialog: {
loading: boolean;
scrim: boolean;
Expand Down
12 changes: 4 additions & 8 deletions frontend/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@ const { activePlatformsDrawer, activeSettingsDrawer } =
storeToRefs(navigationStore);
const router = useRouter();
const auth = storeAuth();
const refreshView = ref(0);
const emitter = inject<Emitter<Events>>("emitter");
emitter?.on("refreshDrawer", async () => {
const { data: platformData } = await platformApi.getPlatforms();
platformsStore.set(platformData);
});
emitter?.on("refreshView", async () => {
refreshView.value = refreshView.value + 1;
});
// Functions
function goHome() {
Expand Down Expand Up @@ -199,7 +195,7 @@ onMounted(async () => {
<v-img
:src="
auth.user?.avatar_path
? `/assets/romm/assets/${auth.user?.avatar_path}`
? `/assets/romm/assets/${auth.user?.avatar_path}?ts=${auth.user?.updated_at}`
: defaultAvatarPath
"
/>
Expand Down Expand Up @@ -275,7 +271,7 @@ onMounted(async () => {
<v-img
:src="
auth.user?.avatar_path
? `/assets/romm/assets/${auth.user?.avatar_path}`
? `/assets/romm/assets/${auth.user?.avatar_path}?ts=${auth.user?.updated_at}`
: defaultAvatarPath
"
/>
Expand Down Expand Up @@ -313,7 +309,7 @@ onMounted(async () => {
<v-img
:src="
auth.user?.avatar_path
? `/assets/romm/assets/${auth.user?.avatar_path}`
? `/assets/romm/assets/${auth.user?.avatar_path}?ts=${auth.user?.updated_at}`
: defaultAvatarPath
"
cover
Expand Down Expand Up @@ -363,7 +359,7 @@ onMounted(async () => {
</v-navigation-drawer>

<new-version />
<router-view :key="refreshView" />
<router-view />

<delete-platform-dialog />
<search-rom-dialog />
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/Play/Base.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { FirmwareSchema, SaveSchema, StateSchema } from "@/__generated__";
import RAvatar from "@/components/common/Game/Avatar.vue";
import RAvatar from "@/components/common/Game/RAvatar.vue";
import firmwareApi from "@/services/api/firmware";
import romApi from "@/services/api/rom";
import type { DetailedRom } from "@/stores/roms";
Expand Down Expand Up @@ -96,7 +96,7 @@ onMounted(async () => {
!rom.igdb_id && !rom.moby_id
? `/assets/default/cover/small_${theme.global.name.value}_unmatched.png`
: rom.has_cover
? `/assets/romm/resources/${rom.path_cover_s}`
? `/assets/romm/resources/${rom.path_cover_s}?ts=${rom.updated_at}`
: `/assets/default/cover/small_${theme.global.name.value}_missing_cover.png`
"
/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/Scan.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import RAvatar from "@/components/common/Game/Avatar.vue";
import RAvatar from "@/components/common/Game/RAvatar.vue";
import PlatformIcon from "@/components/common/Platform/Icon.vue";
import socket from "@/services/socket";
import storeHeartbeat from "@/stores/heartbeat";
Expand Down Expand Up @@ -343,7 +343,7 @@ async function stopScan() {
!rom.igdb_id && !rom.moby_id
? `/assets/default/cover/small_${theme.global.name.value}_unmatched.png`
: rom.has_cover
? `/assets/romm/resources/${rom.path_cover_s}`
? `/assets/romm/resources/${rom.path_cover_s}?ts=${rom.updated_at}`
: `/assets/default/cover/small_${theme.global.name.value}_missing_cover.png`
"
/>
Expand Down

0 comments on commit 9a86df5

Please sign in to comment.