Skip to content

Commit

Permalink
Fixes error "Can't initialize Yasgui!" when loading the explore (reso…
Browse files Browse the repository at this point in the history
…urce) view.

## What
 An exception occurs when the resource view is opened.

## Why
 The language setting was done before the ontotext-yasgui-web-component was initialized, which caused the exception to be thrown by the component.

## How
 The initialization of the language has been moved after the component initialization.
  • Loading branch information
boyan-tonchev committed Aug 9, 2023
1 parent f2d8257 commit 68c6ef6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ function yasguiComponentDirective(
},
link: ($scope, element, attrs) => {
$scope.classToApply = attrs.class || '';
$scope.language = $languageService.getLanguage();
const downloadAsPluginNameToEventHandler = new Map();
const outputHandlers = new Map();

Expand Down Expand Up @@ -353,6 +352,7 @@ function yasguiComponentDirective(
}

addDirtyCheckHandlers();
$scope.language = $languageService.getLanguage();
}
};

Expand Down
2 changes: 0 additions & 2 deletions src/js/angular/explore/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ ExploreCtrl.$inject = [
'FileTypes',
'$jwtAuth',
'$translate',
'$languageService',
'$q',
'ExploreRestService'];

Expand All @@ -55,7 +54,6 @@ function ExploreCtrl(
FileTypes,
$jwtAuth,
$translate,
$languageService,
$q,
ExploreRestService) {

Expand Down

0 comments on commit 68c6ef6

Please sign in to comment.