Skip to content

Commit

Permalink
fix #3209 collabora open when nextcloud is in a iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoel974 committed Feb 1, 2024
1 parent d0f275e commit b26b94b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/helpers/coolParameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const getUIDefaults = () => {
const uiMode = defaults.UIMode ?? 'notebookbar' // or notebookbar

const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
// FIXME For now we need to access parent here as the public page loaded for collabora doesn't have the user theme
const nextcloudDarkMode = parent.document.body.dataset.themeDark === '' || parent.document.body.dataset.themeDarkHighcontrast === ''
const matchedDarkMode = parent.document.body.dataset.themeDefault === '' ? systemDarkMode : nextcloudDarkMode
const dataSet = document.body.dataset?.themeDark ? document.body.dataset : parent.document.body.dataset

Check failure on line 34 in src/helpers/coolParameters.js

View workflow job for this annotation

GitHub Actions / NPM lint

'dataSet' is assigned a value but never used
const nextcloudDarkMode = dataset?.themeDark === '' || dataset?.themeDarkHighcontrast === ''

Check failure on line 35 in src/helpers/coolParameters.js

View workflow job for this annotation

GitHub Actions / NPM lint

'dataset' is not defined

Check failure on line 35 in src/helpers/coolParameters.js

View workflow job for this annotation

GitHub Actions / NPM lint

'dataset' is not defined
const matchedDarkMode = dataset?.themeDefault === '' ? systemDarkMode : nextcloudDarkMode

Check failure on line 36 in src/helpers/coolParameters.js

View workflow job for this annotation

GitHub Actions / NPM lint

'dataset' is not defined
const uiTheme = matchedDarkMode ? 'dark' : 'light'

let uiDefaults = 'TextRuler=' + textRuler + ';'
Expand Down

0 comments on commit b26b94b

Please sign in to comment.