Commit 6f02d232 authored by Konstantin Schulz's avatar Konstantin Schulz
Browse files

fixed initialization of mostRecentSetup and currentURN

parent 158baca7
{ {
"name": "mc_frontend", "name": "mc_frontend",
"version": "1.0.2", "version": "1.0.3",
"author": "Ionic Framework", "author": "Ionic Framework",
"homepage": "https://ionicframework.com/", "homepage": "https://ionicframework.com/",
"scripts": { "scripts": {
......
...@@ -62,9 +62,7 @@ export class CorpusService { ...@@ -62,9 +62,7 @@ export class CorpusService {
HelperService.waitForConfig().then(() => { HelperService.waitForConfig().then(() => {
this.checkForUpdates(); this.checkForUpdates();
this.checkAnnisResponse().then(() => { this.checkAnnisResponse().then(() => {
if (HelperService.mostRecentSetup) { this.restoreLastCorpus().then();
this.restoreLastCorpus().then();
}
}, () => { }, () => {
}); });
}); });
......
...@@ -240,6 +240,7 @@ export class HelperService { ...@@ -240,6 +240,7 @@ export class HelperService {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
this.storage.get(HelperService.config['localStorageKeyMostRecentSetup']).then((mrs: string) => { this.storage.get(HelperService.config['localStorageKeyMostRecentSetup']).then((mrs: string) => {
if (!mrs) { if (!mrs) {
HelperService.mostRecentSetup = new ApplicationState();
return reject(); return reject();
} }
HelperService.mostRecentSetup = JSON.parse(mrs); HelperService.mostRecentSetup = JSON.parse(mrs);
......
...@@ -69,7 +69,7 @@ export class PreviewPage implements OnDestroy { ...@@ -69,7 +69,7 @@ export class PreviewPage implements OnDestroy {
this.corpusService.annisResponse.solutions = ar.solutions; this.corpusService.annisResponse.solutions = ar.solutions;
this.processSolutions(ar.solutions); this.processSolutions(ar.solutions);
this.corpusService.annisResponse.uri = ar.uri; this.corpusService.annisResponse.uri = ar.uri;
const isUrn: boolean = this.corpusService.currentUrn.startsWith('urn:'); const isUrn: boolean = this.corpusService.currentUrn && this.corpusService.currentUrn.startsWith('urn:');
this.corpusService.annisResponse.nodes = isUrn ? this.corpusService.annisResponse.nodes : ar.nodes; this.corpusService.annisResponse.nodes = isUrn ? this.corpusService.annisResponse.nodes : ar.nodes;
this.corpusService.annisResponse.links = isUrn ? this.corpusService.annisResponse.links : ar.links; this.corpusService.annisResponse.links = isUrn ? this.corpusService.annisResponse.links : ar.links;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment