Component view error handling, extensions-manager submodule
This commit is contained in:
@@ -82,14 +82,20 @@ class ComponentView {
|
||||
var expired, offlineRestricted, urlError;
|
||||
|
||||
offlineRestricted = component.offlineOnly && !isDesktopApplication();
|
||||
urlError = !isDesktopApplication() && (!component.url && !component.hosted_url);
|
||||
|
||||
urlError =
|
||||
(!isDesktopApplication() && (!component.url && !component.hosted_url))
|
||||
||
|
||||
(isDesktopApplication() && (!component.local_url && !component.url && !component.hosted_url))
|
||||
|
||||
expired = component.valid_until && component.valid_until <= new Date();
|
||||
|
||||
$scope.componentValid = !offlineRestricted && !urlError && !expired;
|
||||
|
||||
if(offlineRestricted) $scope.error = 'offline-restricted';
|
||||
if(urlError) $scope.error = 'url-missing';
|
||||
if(expired) $scope.error = 'expired';
|
||||
else if(urlError) $scope.error = 'url-missing';
|
||||
else if(expired) $scope.error = 'expired';
|
||||
else $scope.error = null;
|
||||
|
||||
if($scope.componentValid !== previouslyValid) {
|
||||
if($scope.componentValid) {
|
||||
|
||||
@@ -57,6 +57,10 @@
|
||||
%h2.title This extension is not installed correctly.
|
||||
%p Please uninstall {{component.name}}, then re-install it.
|
||||
|
||||
%p
|
||||
This issue can occur if you access Standard Notes using an older version of the app.
|
||||
Ensure you are running at least version 2.1 on all platforms.
|
||||
|
||||
|
||||
%iframe{"ng-if" => "component && componentValid",
|
||||
"ng-attr-id" => "component-{{component.uuid}}",
|
||||
|
||||
Reference in New Issue
Block a user