Compare commits

..

2 Commits

Author SHA1 Message Date
Spythere c0d188424a chore: added information about new domain for the old website 2026-04-14 00:14:06 +02:00
Spythere f22cf93cb1 merge: development 2026-04-14 00:01:54 +02:00
2 changed files with 31 additions and 49 deletions
+31 -47
View File
@@ -1,21 +1,16 @@
<template>
<AppModals />
<ImageFullscreenPreview v-if="store.vehiclePreviewSrc" />
<transition name="slide-bottom-anim">
<MigrationInfo v-if="store.isMigrationInfoOpen" />
</transition>
<router-view></router-view>
<div class="migration-info">
<img src="/favicon.svg" alt="logo" width="120" />
<h1><span class="text--accent">Aplikacja</span> została przeniesiona na nową domenę!</h1>
<h1><span class="text--accent">This app</span> has been moved to a new domain!</h1>
<a href="http://pojazdownik-td2.spythere.eu/">http://pojazdownik-td2.spythere.eu/</a>
</div>
</template>
<script lang="ts" setup>
import { useStore } from './store';
import ImageFullscreenPreview from './components/utils/ImageFullscreenPreview.vue';
import AppModals from './components/app/AppModals.vue';
import { computed, onMounted, watchEffect } from 'vue';
import { computed, watchEffect } from 'vue';
import { registerSW } from 'virtual:pwa-register';
import MigrationInfo from './components/app/MigrationInfo.vue';
const store = useStore();
@@ -23,12 +18,6 @@ registerSW({
immediate: true,
});
onMounted(() => {
loadStockDataFromStorage();
handleMigrationInfo();
store.setupAPIData();
});
const currentStockString = computed(() => store.stockString);
watchEffect(() => {
@@ -36,35 +25,6 @@ watchEffect(() => {
store.chosenStorageStockName = '';
}
});
function handleMigrationInfo() {
// Show only on old domain
if (location.hostname !== 'pojazdownik-td2.web.app') return;
const showInfo = localStorage.getItem('showMigrationInfo');
// Do not show if already acknowledged
if (showInfo === 'false') return;
setTimeout(() => {
store.isMigrationInfoOpen = true;
}, 2000);
}
function loadStockDataFromStorage() {
const savedData = localStorage.getItem('savedStockData');
if (!savedData) {
localStorage.setItem('savedStockData', JSON.stringify({}));
return;
}
try {
store.storageStockData = JSON.parse(savedData);
} catch (error) {
console.error('Wystąpił błąd podczas przetwarzania danych o składach z localStorage!', error);
}
}
</script>
<style lang="scss">
@@ -83,4 +43,28 @@ function loadStockDataFromStorage() {
font-size: calc(0.7rem + 0.75vw);
}
}
.migration-info {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
min-height: 100vh;
text-align: center;
padding: 1em;
img {
margin-bottom: 2em;
}
h1 {
margin: 0;
}
a {
font-size: 1.85em;
margin-top: 1em;
text-decoration: underline;
}
}
</style>
-2
View File
@@ -134,8 +134,6 @@ export const useStore = defineStore('store', {
...v,
group: response.vehicleGroups.find((g) => g.id == v.vehicleGroupsId)!,
}));
console.log(response);
} catch (error) {
console.error(error);
}