Bilder fix Datenblatt
This commit is contained in:
@@ -5,11 +5,10 @@
|
||||
AufnahmeClient,
|
||||
BenutzerClient,
|
||||
UnterlageClient,
|
||||
GEGNachweisWohnenClient,
|
||||
BildClient,
|
||||
} from "#components/Ausweis/types.js";
|
||||
import Bereich from "#components/labels/Bereich.svelte";
|
||||
import { Enums } from "#lib/client/prisma.js";
|
||||
import { BedarfsausweisGewerbe, Enums } from "#lib/client/prisma.js";
|
||||
import Progressbar from "#components/Ausweis/Progressbar.svelte";
|
||||
import FileGrid from "#components/FileGrid.svelte";
|
||||
import ButtonWeiterHilfe from "#components/Ausweis/ButtonWeiterHilfe.svelte";
|
||||
@@ -18,57 +17,45 @@
|
||||
import SanierungszustandFensterTueren from "#components/Ausweis/SanierungszustandFensterTueren.svelte";
|
||||
import SanierungszustandWaermedammung from "#components/Ausweis/SanierungszustandWaermedammung.svelte";
|
||||
import AnlagenTechnik from "#components/Ausweis/AnlagenTechnik.svelte";
|
||||
import moment from "moment";
|
||||
|
||||
export let nachweis: GEGNachweisWohnenClient;
|
||||
export let nachweis: BedarfsausweisGewerbe;
|
||||
export let objekt: ObjektClient;
|
||||
export let aufnahme: AufnahmeClient;
|
||||
export let user: BenutzerClient = {} as BenutzerClient;
|
||||
export let bilder: BildClient[] = [];
|
||||
export let plaene: UnterlageClient[] = [];
|
||||
export let unterlagen: UnterlageClient[] = [];
|
||||
export let ausweistyp: Enums.AusweisTyp;
|
||||
export let id: string | null;
|
||||
|
||||
if (Object.keys(nachweis).length === 0) {
|
||||
const localStorageAusweis = localStorage.getItem(
|
||||
"geg-nachweis-wohnen.ausweis"
|
||||
);
|
||||
// Falls die Daten im localStorage neuer sind als der Ausweis den wir von der Datenbank bekommen haben, benutzen wir lieber diese.
|
||||
// Wir schauen auch ob der Benutzer nicht vielleicht ein Admin ist, dann sollten wir nichts aus dem localStorage holen.
|
||||
if ((user && user.rolle !== Enums.BenutzerRolle.ADMIN) && !id && (!nachweis.updated_at || moment(localStorage.getItem("geg-nachweis-wohnen.updated_at") || new Date()).isAfter(nachweis.updated_at))) {
|
||||
const localStorageAusweis = localStorage.getItem("geg-nachweis-wohnen.ausweis");
|
||||
if (localStorageAusweis) {
|
||||
nachweis = JSON.parse(localStorageAusweis);
|
||||
nachweis = JSON.parse(localStorageAusweis)
|
||||
nachweis.nachweistyp = ausweistyp;
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(aufnahme).length === 0) {
|
||||
const localStorageAufnahme = localStorage.getItem(
|
||||
"geg-nachweis-wohnen.aufnahme"
|
||||
);
|
||||
const localStorageAufnahme = localStorage.getItem("geg-nachweis-wohnen.aufnahme");
|
||||
if (localStorageAufnahme) {
|
||||
aufnahme = JSON.parse(localStorageAufnahme);
|
||||
aufnahme = JSON.parse(localStorageAufnahme)
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(objekt).length === 0) {
|
||||
const localStorageObjekt = localStorage.getItem(
|
||||
"geg-nachweis-wohnen.objekt"
|
||||
);
|
||||
const localStorageObjekt = localStorage.getItem("geg-nachweis-wohnen.objekt");
|
||||
if (localStorageObjekt) {
|
||||
objekt = JSON.parse(localStorageObjekt);
|
||||
objekt = JSON.parse(localStorageObjekt)
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(bilder).length === 0) {
|
||||
const localStorageBilder = localStorage.getItem(
|
||||
"geg-nachweis-wohnen.bilder"
|
||||
);
|
||||
const localStorageBilder = localStorage.getItem("geg-nachweis-wohnen.bilder");
|
||||
if (localStorageBilder) {
|
||||
bilder = JSON.parse(localStorageBilder);
|
||||
bilder = JSON.parse(localStorageBilder)
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(unterlagen).length === 0) {
|
||||
const localStorageUnterlagen = localStorage.getItem(
|
||||
"geg-nachweis-wohnen.unterlagen"
|
||||
);
|
||||
const localStorageUnterlagen = localStorage.getItem("geg-nachweis-wohnen.unterlagen");
|
||||
if (localStorageUnterlagen) {
|
||||
unterlagen = JSON.parse(localStorageUnterlagen);
|
||||
bilder = JSON.parse(localStorageUnterlagen)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +99,7 @@
|
||||
{ausweisart}
|
||||
{anliegen}
|
||||
steps={["Gebäudedaten", "Kundendaten", "Anfragebestätigung"]}
|
||||
{ausweistyp}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user