fix: component expiration for custom extensions
This commit is contained in:
@@ -25,7 +25,7 @@ export const IsExpired: FunctionalComponent<IProps> = ({
|
|||||||
rel={'noopener'}
|
rel={'noopener'}
|
||||||
target={'_blank'}
|
target={'_blank'}
|
||||||
>
|
>
|
||||||
Your Extended subscription expired on {expiredDate}
|
Your subscription expired on {expiredDate}
|
||||||
</a>
|
</a>
|
||||||
<div className={'sk-p'}>
|
<div className={'sk-p'}>
|
||||||
Extensions are in a read-only state.
|
Extensions are in a read-only state.
|
||||||
|
|||||||
@@ -82,12 +82,12 @@ export const ComponentView: FunctionalComponent<IProps> = observer(
|
|||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
|
|
||||||
setIsExpired(component.valid_until && component.valid_until <= new Date());
|
setIsExpired(component.isExpired);
|
||||||
|
|
||||||
const readonlyState = application.componentManager!.getReadonlyStateForComponent(component);
|
const readonlyState = application.componentManager.getReadonlyStateForComponent(component);
|
||||||
|
|
||||||
if (!readonlyState.lockReadonly) {
|
if (!readonlyState.lockReadonly) {
|
||||||
application.componentManager!.setReadonlyStateForComponent(component, isExpired);
|
application.componentManager.setReadonlyStateForComponent(component, isExpired);
|
||||||
}
|
}
|
||||||
setIsComponentValid(!offlineRestricted && !hasUrlError);
|
setIsComponentValid(!offlineRestricted && !hasUrlError);
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ export const ComponentView: FunctionalComponent<IProps> = observer(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
clearTimeout(loadTimeout);
|
clearTimeout(loadTimeout);
|
||||||
await application.componentManager!.registerComponentWindow(
|
await application.componentManager.registerComponentWindow(
|
||||||
component,
|
component,
|
||||||
iframe.contentWindow!
|
iframe.contentWindow!
|
||||||
);
|
);
|
||||||
@@ -198,7 +198,7 @@ export const ComponentView: FunctionalComponent<IProps> = observer(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const iframe = application.componentManager!.iframeForComponent(
|
const iframe = application.componentManager.iframeForComponent(
|
||||||
component.uuid
|
component.uuid
|
||||||
);
|
);
|
||||||
if (!iframe) {
|
if (!iframe) {
|
||||||
@@ -218,7 +218,7 @@ export const ComponentView: FunctionalComponent<IProps> = observer(
|
|||||||
const expiredDate = isExpired ? component.dateToLocalizedString(component.valid_until) : '';
|
const expiredDate = isExpired ? component.dateToLocalizedString(component.valid_until) : '';
|
||||||
|
|
||||||
const getUrl = () => {
|
const getUrl = () => {
|
||||||
const url = component ? application.componentManager!.urlForComponent(component) : '';
|
const url = component ? application.componentManager.urlForComponent(component) : '';
|
||||||
return url as string;
|
return url as string;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -265,13 +265,13 @@ export const ComponentView: FunctionalComponent<IProps> = observer(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const unregisterComponentHandler = application.componentManager!.registerHandler({
|
const unregisterComponentHandler = application.componentManager.registerHandler({
|
||||||
identifier: 'component-view-' + Math.random(),
|
identifier: 'component-view-' + Math.random(),
|
||||||
areas: [component.area],
|
areas: [component.area],
|
||||||
actionHandler: (component, action, data) => {
|
actionHandler: (component, action, data) => {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case (ComponentAction.SetSize):
|
case (ComponentAction.SetSize):
|
||||||
application.componentManager!.handleSetSizeEvent(component, data);
|
application.componentManager.handleSetSizeEvent(component, data);
|
||||||
break;
|
break;
|
||||||
case (ComponentAction.KeyDown):
|
case (ComponentAction.KeyDown):
|
||||||
application.io.handleComponentKeyDown(data.keyboardModifier);
|
application.io.handleComponentKeyDown(data.keyboardModifier);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "standard-notes-web",
|
"name": "standard-notes-web",
|
||||||
"version": "3.9.2",
|
"version": "3.9.3",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
"@reach/listbox": "^0.16.2",
|
"@reach/listbox": "^0.16.2",
|
||||||
"@standardnotes/features": "1.8.1",
|
"@standardnotes/features": "1.8.1",
|
||||||
"@standardnotes/sncrypto-web": "1.5.3",
|
"@standardnotes/sncrypto-web": "1.5.3",
|
||||||
"@standardnotes/snjs": "2.17.6",
|
"@standardnotes/snjs": "2.17.7",
|
||||||
"mobx": "^6.3.5",
|
"mobx": "^6.3.5",
|
||||||
"mobx-react-lite": "^3.2.1",
|
"mobx-react-lite": "^3.2.1",
|
||||||
"preact": "^10.5.15",
|
"preact": "^10.5.15",
|
||||||
|
|||||||
@@ -2199,10 +2199,10 @@
|
|||||||
buffer "^6.0.3"
|
buffer "^6.0.3"
|
||||||
libsodium-wrappers "^0.7.9"
|
libsodium-wrappers "^0.7.9"
|
||||||
|
|
||||||
"@standardnotes/snjs@2.17.6":
|
"@standardnotes/snjs@2.17.7":
|
||||||
version "2.17.6"
|
version "2.17.7"
|
||||||
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.6.tgz#ce432bd820b565f97e7dbdd096a056f504c1615a"
|
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.7.tgz#10f56e46d6a992e84da94fb7b9ec8dfc8a9a8da3"
|
||||||
integrity sha512-UGRgxzVdMlwGX9xTdve/Cq+H/gDeI8OTyrr2mGeMA79JhhfUwSaEGbriLGkmA9moDctUK+/m79oMtXg/r5Kbtw==
|
integrity sha512-7BxEywqhIfYHfkKDlS466vMeWPznXwXrQVj21eKG4ibiAyYhuTXRUYhnCwZKdloNm9Wl0iChJXuiWfev2+tGqg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@standardnotes/auth" "^3.8.1"
|
"@standardnotes/auth" "^3.8.1"
|
||||||
"@standardnotes/common" "^1.2.1"
|
"@standardnotes/common" "^1.2.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user