Skip to content

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

milkdown-v7

sytolk0481775d4ef6
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index 43c5bd05b..5d4e8f188 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -395,7 +395,8 @@ function EntryContainer(props: Props) {
};
}, [openedFile.isAutoSaveEnabled, fileChanged.current]);
- useEffect(() => {
+ // editor is not loaded in this time - change theme after loadDefaultTextContent
+ /*useEffect(() => {
if (
fileViewer &&
fileViewer.current &&
@@ -406,7 +407,7 @@ function EntryContainer(props: Props) {
// @ts-ignore call setContent from iframe
fileViewer.current.contentWindow.setTheme(settings.currentTheme);
}
- }, [settings.currentTheme]);
+ }, [settings.currentTheme]);*/
useEffect(() => {
// if (openedFiles.length > 0) {
@@ -505,7 +506,7 @@ function EntryContainer(props: Props) {
}
textFilePath = openedFile.path;
- if (
+ /*if (
fileViewer &&
fileViewer.current &&
fileViewer.current.contentWindow &&
@@ -514,7 +515,7 @@ function EntryContainer(props: Props) {
) {
// @ts-ignore call setContent from iframe
fileViewer.current.contentWindow.setTheme(settings.currentTheme);
- }
+ }*/
// TODO make loading index.html for folders configurable
// if (!this.state.currentEntry.isFile) {
// textFilePath += '/index.html';
@@ -557,7 +558,8 @@ function EntryContainer(props: Props) {
fileViewer.current.contentWindow.setContent(
content,
fileDirectory,
- !openedFile.editMode
+ !openedFile.editMode,
+ settings.currentTheme
);
}
if (currentLocationId) {
@@ -1591,7 +1593,6 @@ function EntryContainer(props: Props) {
fileViewer={fileViewer}
fileViewerContainer={fileViewerContainer}
toggleFullScreen={toggleFullScreen}
- currentTheme={settings.currentTheme}
eventID={eventID.current}
/>
</Split>
diff --git a/app/components/FileView.tsx b/app/components/FileView.tsx
index cda96a6fd..ad4160e81 100644
--- a/app/components/FileView.tsx
+++ b/app/components/FileView.tsx
@@ -35,7 +35,7 @@ interface Props {
searchQuery: TS.SearchQuery;
toggleFullScreen?: () => void;
height?: string;
- currentTheme: string;
+ //currentTheme: string;
eventID: string;
}
@@ -49,7 +49,7 @@ function FileView(props: Props) {
toggleFullScreen,
searchQuery,
height,
- currentTheme,
+ //currentTheme,
eventID
} = props; // .openedFiles[0];
@@ -99,7 +99,7 @@ function FileView(props: Props) {
: '';
const locale = '&locale=' + i18n.language;
const theming =
- '&theme=' + currentTheme + extPrimaryColor + extTextColor + extBgndColor;
+ '&theme=' + theme.palette.mode + extPrimaryColor + extTextColor + extBgndColor;
if (openedFile.editMode && openedFile.editingExtensionPath) {
fileOpenerURL =
diff --git a/app/components/dialogs/FilePreviewDialog.tsx b/app/components/dialogs/FilePreviewDialog.tsx
index 212e03baf..1d1a12acc 100644
--- a/app/components/dialogs/FilePreviewDialog.tsx
+++ b/app/components/dialogs/FilePreviewDialog.tsx
@@ -101,7 +101,7 @@ function FilePreviewDialog(props: Props) {
}
textFilePath = openedFile.path;
- if (
+ /*if (
fileViewer &&
fileViewer.current &&
fileViewer.current.contentWindow &&
@@ -110,7 +110,7 @@ function FilePreviewDialog(props: Props) {
) {
// @ts-ignore call setContent from iframe
fileViewer.current.contentWindow.setTheme(currentTheme);
- }
+ }*/
dispatch(
LocationActions.switchLocationType(openedFile.locationId)
@@ -149,7 +149,8 @@ function FilePreviewDialog(props: Props) {
fileViewer.current.contentWindow.setContent(
content,
fileDirectory,
- !openedFile.editMode
+ !openedFile.editMode,
+ currentTheme
);
}
if (currentLocationId) {
@@ -212,7 +213,6 @@ function FilePreviewDialog(props: Props) {
fileViewer={fileViewer}
fileViewerContainer={fileViewerContainer}
height={'90%'}
- currentTheme={currentTheme}
eventID={eventID.current}
/>
</DialogContent>