mirror of
https://github.com/rommapp/romm.git
synced 2026-12-06 15:54:45 +01:00
add updated label to save state cards
This commit is contained in:
6 files changed
+15
-7
No files matched your search
@@ -173,7 +173,7 @@ function onCardClick(save: SaveSchema, event: MouseEvent) {
|
||||
{{ formatBytes(save.file_size_bytes) }}
|
||||
</v-chip>
|
||||
<v-chip size="x-small" label>
|
||||
{{ formatTimestamp(save.updated_at) }}
|
||||
Updated: {{ formatTimestamp(save.updated_at) }}
|
||||
</v-chip>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
|
||||
@@ -175,7 +175,7 @@ function onCardClick(state: StateSchema, event: MouseEvent) {
|
||||
{{ formatBytes(state.file_size_bytes) }}
|
||||
</v-chip>
|
||||
<v-chip size="x-small" label>
|
||||
{{ formatTimestamp(state.updated_at) }}
|
||||
Updated: {{ formatTimestamp(state.updated_at) }}
|
||||
</v-chip>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
|
||||
@@ -100,7 +100,7 @@ function closeDialog() {
|
||||
{{ formatBytes(save.file_size_bytes) }}
|
||||
</v-chip>
|
||||
<v-chip size="x-small" label>
|
||||
{{ formatTimestamp(save.updated_at) }}
|
||||
Updated: {{ formatTimestamp(save.updated_at) }}
|
||||
</v-chip>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
|
||||
@@ -100,7 +100,7 @@ function closeDialog() {
|
||||
{{ formatBytes(state.file_size_bytes) }}
|
||||
</v-chip>
|
||||
<v-chip size="x-small" label>
|
||||
{{ formatTimestamp(state.updated_at) }}
|
||||
Updated: {{ formatTimestamp(state.updated_at) }}
|
||||
</v-chip>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
|
||||
@@ -4,7 +4,7 @@ import RomListItem from "@/components/common/Game/ListItem.vue";
|
||||
import firmwareApi from "@/services/api/firmware";
|
||||
import romApi from "@/services/api/rom";
|
||||
import storeAuth from "@/stores/auth";
|
||||
import type { DetailedRom } from "@/stores/roms";
|
||||
import storeRoms, { type DetailedRom } from "@/stores/roms";
|
||||
import { formatBytes, formatTimestamp, getSupportedEJSCores } from "@/utils";
|
||||
import { ROUTES } from "@/plugins/router";
|
||||
import Player from "@/views/Player/EmulatorJS/Player.vue";
|
||||
@@ -24,6 +24,7 @@ const EMULATORJS_VERSION = "4.2.1";
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const auth = storeAuth();
|
||||
const romsStore = storeRoms();
|
||||
const rom = ref<DetailedRom | null>(null);
|
||||
const firmwareOptions = ref<FirmwareSchema[]>([]);
|
||||
const biosRef = ref<FirmwareSchema | null>(null);
|
||||
@@ -70,6 +71,7 @@ function onFullScreenChange() {
|
||||
}
|
||||
|
||||
async function onlyQuit() {
|
||||
if (rom.value) romsStore.update(rom.value);
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
@@ -94,6 +96,7 @@ async function saveAndQuit() {
|
||||
screenshotFile,
|
||||
});
|
||||
|
||||
romsStore.update(rom.value);
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
|
||||
@@ -67,13 +67,18 @@ export async function saveSave({
|
||||
}): Promise<SaveSchema | null> {
|
||||
if (save) {
|
||||
try {
|
||||
const { data: updateSave } = await saveApi.updateSave({
|
||||
const { data: updatedSave } = await saveApi.updateSave({
|
||||
save: save,
|
||||
saveFile: new File([saveFile], save.file_name, {
|
||||
type: "application/octet-stream",
|
||||
}),
|
||||
});
|
||||
return updateSave;
|
||||
|
||||
// Update the save in the rom object
|
||||
const index = rom.user_saves.findIndex((s) => s.id === updatedSave.id);
|
||||
rom.user_saves[index] = updatedSave;
|
||||
|
||||
return updatedSave;
|
||||
} catch (error) {
|
||||
console.error("Failed to update save", error);
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user