Skip to content

Commit

Permalink
Merge pull request #550 from Neriderc/fix-url-xref
Browse files Browse the repository at this point in the history
Fix url xref
  • Loading branch information
Neriderc authored Dec 13, 2024
2 parents 25de7e2 + 2325d3b commit 3f53f49
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions resources/javascript/gvexport.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ function stopIndiSelectChanged() {
}

function loadXrefList(url, xrefListId, indiListId) {
if (url === '') return false;

let xrefListEl = document.getElementById(xrefListId);
let xref_list = xrefListEl.value.trim();
xrefListEl.value = xref_list;
Expand Down Expand Up @@ -243,29 +245,24 @@ function showGraphvizUnsupportedMessage() {
}

// This function is run when the page is loaded
function pageLoaded(Url) {

// Load settings for logged out user
async function pageLoaded(Url) {
if (firstRender) {
isUserLoggedIn().then((loggedIn) => {
if (!loggedIn) {
Data.storeSettings.getSettingsClient(ID_MAIN_SETTINGS).then((obj) => {
if (obj !== null) {
Form.settings.load(JSON.stringify(obj));
} else {
firstRender = false;
}
})
const loggedIn = await isUserLoggedIn();
if (!loggedIn) {
const settings = await Data.storeSettings.getSettingsClient(ID_MAIN_SETTINGS);
if (settings !== null) {
Form.settings.load(JSON.stringify(settings));
} else {
firstRender = false;
}

loadURLXref(Url);
refreshIndisFromXREFS(false);
});
}
}

TOMSELECT_URL = document.getElementById('pid').getAttribute("data-wt-url") + "&query=";
loadUrlToken(Url);
loadSettingsDetails();
loadURLXref(Url);
refreshIndisFromXREFS(false);
// Remove reset parameter from URL when page loaded, to prevent
// further resets when page reloaded
Url.removeURLParameter("reset");
Expand Down

0 comments on commit 3f53f49

Please sign in to comment.