Component view error handling, extensions-manager submodule

This commit is contained in:
Mo Bitar
2018-02-04 11:24:48 -06:00
parent 805fc48da4
commit 84d68e8f68
3 changed files with 14 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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}}",