Skip to content

TagSpaces is an offline, open source, document manager with tagging support

feat: improving theme support for extensions

Ilian Sapundshiev68df957568c6
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index 1b9a8847a..def28f4c6 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -1022,6 +1022,7 @@ const EntryContainer = (props: Props) => {
fileViewer={fileViewer}
fileViewerContainer={fileViewerContainer}
toggleFullScreen={toggleFullScreen}
+ currentTheme={props.settings.currentTheme}
/>
</Split>
);
diff --git a/app/components/FileView.tsx b/app/components/FileView.tsx
index 36e9afd95..02ddadfe6 100644
--- a/app/components/FileView.tsx
+++ b/app/components/FileView.tsx
@@ -31,6 +31,7 @@ interface Props {
fileViewerContainer: MutableRefObject<HTMLDivElement>;
toggleFullScreen: () => void;
theme: any;
+ currentTheme: string;
}
const FileView = (props: Props) => {
@@ -40,7 +41,8 @@ const FileView = (props: Props) => {
fileViewer,
isFullscreen,
fileViewerContainer,
- toggleFullScreen
+ toggleFullScreen,
+ currentTheme
} = props; // .openedFiles[0];
useEventListener('toggle-resume', () => {
@@ -64,6 +66,7 @@ const FileView = (props: Props) => {
// }
const locale = '&locale=' + i18n.language;
+ const theme = '&theme=' + currentTheme;
if (openedFile.editMode && openedFile.editingExtensionPath) {
fileOpenerURL =
@@ -71,6 +74,7 @@ const FileView = (props: Props) => {
'/index.html?file=' +
encodeURIComponent(openedFile.url ? openedFile.url : openedFile.path) +
locale +
+ theme +
'&edit=true' +
(openedFile.shouldReload === true ? '&t=' + new Date().getTime() : '');
// } else if (!currentEntry.isFile) { // TODO needed for loading folder's default html
@@ -81,6 +85,7 @@ const FileView = (props: Props) => {
'/index.html?file=' +
encodeURIComponent(openedFile.url ? openedFile.url : openedFile.path) +
locale +
+ theme +
(openedFile.shouldReload === true ? '&t=' + new Date().getTime() : '');
}
} else {
@@ -136,6 +141,7 @@ const areEqual = (prevProp, nextProp) =>
nextProp.openedFile.editMode === prevProp.openedFile.editMode &&
nextProp.openedFile.shouldReload === prevProp.openedFile.shouldReload &&
nextProp.isFullscreen === prevProp.isFullscreen;
+// nextProp.currentTheme === prevProp.currentTheme; // Commented due to reloading of the editors with changed content
/* ((nextProp.openedFile.editMode === undefined &&
prevProp.openedFile.editMode === true) ||
nextProp.openedFile.editMode === prevProp.openedFile.editMode); */
diff --git a/app/package-template.json b/app/package-template.json
index e4c111e20..842b96240 100644
--- a/app/package-template.json
+++ b/app/package-template.json
@@ -1,10 +1,10 @@
{
"webDependencies": {
- "@tagspaces/extensions": "1.0.15"
+ "@tagspaces/extensions": "1.0.16"
},
"nodeDependencies": {
"@tagspaces/tagspaces-ws": "1.2.1",
- "@tagspaces/extensions": "1.0.15",
+ "@tagspaces/extensions": "1.0.16",
"sharp": "^0.29.3"
}
}