ui: Correctly redirect to the latest zone id on change
This commit is contained in:
parent
7fde74b3ae
commit
956fcd4a53
|
@ -59,8 +59,10 @@
|
|||
|
||||
function retrieveZoneDone(zm: ZoneMeta): void {
|
||||
retrievalInProgress = false;
|
||||
if ($page.data.history) {
|
||||
selectedHistory = zm.id;
|
||||
if ($page.data.definedhistory) {
|
||||
refreshDomains().then(() => {
|
||||
goto('/domains/' + encodeURIComponent(selectedDomain) + '/' + encodeURIComponent(zm.id));
|
||||
});
|
||||
} else {
|
||||
invalidateAll();
|
||||
}
|
||||
|
@ -320,7 +322,7 @@
|
|||
<ModalUploadZone
|
||||
domain={data.domain}
|
||||
{selectedHistory}
|
||||
on:retrieveZoneDone={retrieveZoneDone}
|
||||
on:retrieveZoneDone={(ev) => retrieveZoneDone(ev.detail)}
|
||||
/>
|
||||
|
||||
<ModalDomainDelete
|
||||
|
@ -332,5 +334,5 @@
|
|||
<ModalDiffZone
|
||||
domain={data.domain}
|
||||
{selectedHistory}
|
||||
on:retrieveZoneDone={retrieveZoneDone}
|
||||
on:retrieveZoneDone={(ev) => retrieveZoneDone(ev.detail)}
|
||||
/>
|
||||
|
|
|
@ -14,8 +14,10 @@ export const load: Load = async({ parent, params }) => {
|
|||
throw redirect(307, `/domains/${data.domain.domain}/import_zone`);
|
||||
}
|
||||
|
||||
let definedhistory = true;
|
||||
if (!params.historyid) {
|
||||
params.historyid = domain.zone_history[0];
|
||||
definedhistory = false;
|
||||
//throw redirect(307, `/domains/${data.domain.domain}/${domain.zone_history[0]}`);
|
||||
}
|
||||
|
||||
|
@ -33,6 +35,7 @@ export const load: Load = async({ parent, params }) => {
|
|||
return {
|
||||
...data,
|
||||
history: params.historyid,
|
||||
definedhistory,
|
||||
zoneId,
|
||||
streamed: {
|
||||
zone,
|
||||
|
|
Loading…
Reference in New Issue