Skip to content

Commit

Permalink
fix: Add config option to disable edit locally
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliushaertl committed Feb 21, 2024
1 parent b784eeb commit 5570aa7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions lib/Service/InitialStateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,7 @@ private function provideOptions(): void {
$this->initialState->provideInitialState('theming-customLogo', ($logoSet ?
$this->urlGenerator->getAbsoluteURL($this->themingDefaults->getLogo())
: false));

$this->initialState->provideInitialState('open_local_editor', $this->config->getAppValue(Application::APPNAME, 'open_local_editor', 'yes') === 'yes');
}
}
18 changes: 10 additions & 8 deletions src/view/Office.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,16 @@ export default {
this.loading = LOADING_STATE.DOCUMENT_READY
clearTimeout(this.loadingTimeout)
this.sendPostMessage('Host_PostmessageReady')
this.sendPostMessage('Insert_Button', {
id: 'Open_Local_Editor',
imgurl: window.location.protocol + '//' + getNextcloudUrl() + imagePath('richdocuments', 'launch.svg'),
mobile: false,
label: t('richdocuments', 'Open in local editor'),
hint: t('richdocuments', 'Open in local editor'),
insertBefore: 'print',
})
if (loadState('richdocuments', 'open_local_editor', true)) {
this.sendPostMessage('Insert_Button', {
id: 'Open_Local_Editor',
imgurl: window.location.protocol + '//' + getNextcloudUrl() + imagePath('richdocuments', 'launch.svg'),
mobile: false,
label: t('richdocuments', 'Open in local editor'),
hint: t('richdocuments', 'Open in local editor'),
insertBefore: 'print',
})
}
},
async share() {
FilesAppIntegration.share()
Expand Down

0 comments on commit 5570aa7

Please sign in to comment.