Skip to content

Commit

Permalink
Desktop: Removed obsolete template-related banner
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent22 committed Jan 27, 2024
1 parent c94ec4e commit af59295
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
22 changes: 0 additions & 22 deletions packages/app-desktop/app.ts
Expand Up @@ -252,26 +252,6 @@ class Application extends BaseApplication {
});
}

private async checkForLegacyTemplates() {
const templatesDir = `${Setting.value('profileDir')}/templates`;
if (await shim.fsDriver().exists(templatesDir)) {
try {
const files = await shim.fsDriver().readDirStats(templatesDir);
for (const file of files) {
if (file.path.endsWith('.md')) {
// There is at least one template.
this.store().dispatch({
type: 'CONTAINS_LEGACY_TEMPLATES',
});
break;
}
}
} catch (error) {
reg.logger().error(`Failed to read templates directory: ${error}`);
}
}
}

private async initPluginService() {
if (this.initPluginServiceDone_) return;
this.initPluginServiceDone_ = true;
Expand Down Expand Up @@ -549,8 +529,6 @@ class Application extends BaseApplication {
value: Setting.value('flagOpenDevTools'),
});

await this.checkForLegacyTemplates();

// Note: Auto-update is a misnomer in the code.
// The code below only checks, if a new version is available.
// We only allow Windows and macOS users to automatically check for updates
Expand Down
19 changes: 0 additions & 19 deletions packages/app-desktop/gui/MainScreen/MainScreen.tsx
Expand Up @@ -72,7 +72,6 @@ interface Props {
showMissingMasterKeyMessage: boolean;
showNeedUpgradingMasterKeyMessage: boolean;
showShouldReencryptMessage: boolean;
showInstallTemplatesPlugin: boolean;
themeId: number;
settingEditorCodeView: boolean;
pluginsLegacy: any;
Expand Down Expand Up @@ -578,16 +577,6 @@ class MainScreenComponent extends React.Component<Props, State> {
});
};

const onViewPluginScreen = () => {
this.props.dispatch({
type: 'NAV_GO',
routeName: 'Config',
props: {
defaultSection: 'plugins',
},
});
};

const onRestartAndUpgrade = async () => {
Setting.setValue('sync.upgradeState', Setting.SYNC_UPGRADE_STATE_MUST_DO);
await Setting.saveAll();
Expand Down Expand Up @@ -668,12 +657,6 @@ class MainScreenComponent extends React.Component<Props, State> {
_('Set the password'),
onViewEncryptionConfigScreen,
);
} else if (this.props.showInstallTemplatesPlugin) {
msg = this.renderNotificationMessage(
'The template feature has been moved to a plugin called "Templates".',
'Install plugin',
onViewPluginScreen,
);
} else if (this.props.mustUpgradeAppMessage) {
msg = this.renderNotificationMessage(this.props.mustUpgradeAppMessage);
}
Expand All @@ -697,7 +680,6 @@ class MainScreenComponent extends React.Component<Props, State> {
props.isSafeMode ||
this.showShareInvitationNotification(props) ||
this.props.needApiAuth ||
this.props.showInstallTemplatesPlugin ||
!!this.props.mustUpgradeAppMessage;
}

Expand Down Expand Up @@ -934,7 +916,6 @@ const mapStateToProps = (state: AppState) => {
isSafeMode: state.settings.isSafeMode,
enableBetaMarkdownEditor: state.settings['editor.beta'],
needApiAuth: state.needApiAuth,
showInstallTemplatesPlugin: state.hasLegacyTemplates && !state.pluginService.plugins['joplin.plugin.templates'],
isResettingLayout: state.isResettingLayout,
listRendererId: state.settings['notes.listRendererId'],
mustUpgradeAppMessage: state.mustUpgradeAppMessage,
Expand Down
6 changes: 0 additions & 6 deletions packages/lib/reducer.ts
Expand Up @@ -86,7 +86,6 @@ export interface State {
hasDisabledSyncItems: boolean;
hasDisabledEncryptionItems: boolean;
customCss: string;
hasLegacyTemplates: boolean;
collapsedFolderIds: string[];
clipperServer: StateClipperServer;
decryptionWorker: StateDecryptionWorker;
Expand Down Expand Up @@ -146,7 +145,6 @@ export const defaultState: State = {
hasDisabledSyncItems: false,
hasDisabledEncryptionItems: false,
customCss: '',
hasLegacyTemplates: false,
collapsedFolderIds: [],
clipperServer: {
startState: 'idle',
Expand Down Expand Up @@ -1088,10 +1086,6 @@ const reducer = produce((draft: Draft<State> = defaultState, action: any) => {
}
break;

case 'CONTAINS_LEGACY_TEMPLATES':
draft.hasLegacyTemplates = true;
break;

case 'SYNC_STARTED':
draft.syncStarted = true;
break;
Expand Down

0 comments on commit af59295

Please sign in to comment.