Skip to content

Commit

Permalink
Updating to v4.2.8 and Electron 25
Browse files Browse the repository at this point in the history
  • Loading branch information
NickGeek committed Aug 11, 2023
1 parent 5ed9101 commit 9ba1c7f
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 252 deletions.
13 changes: 8 additions & 5 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, BrowserWindow, dialog, ipcMain, Menu, protocol, shell } from 'electron';
import { app, BrowserWindow, dialog, ipcMain, Menu, protocol, shell, net } from 'electron';
import * as path from 'path';
import ContextMenu from 'electron-context-menu';
import { getDicts } from './dicts';
Expand All @@ -9,10 +9,12 @@ const IS_DEV = process.argv.slice(2).includes('--is-dev');
let window: BrowserWindow | null;

function createWindow() {
protocol.interceptFileProtocol('file', (req, callback) => {
let url = req.url.substring(5);
url = path.normalize(path.join(__dirname, 'core', url)).split('?')[0];
callback(url);
protocol.handle('file', (req) => {
console.log(req.url);
let file = new URL(req.url).pathname;
return net.fetch(new URL(path.join(__dirname, 'core', file), 'file:').toString(), {
bypassCustomProtocolHandlers: true
});
});

const windowState = windowStateKeeper({
Expand Down Expand Up @@ -44,6 +46,7 @@ function createWindow() {
windowState.manage(window);

window.webContents.session.setSpellCheckerEnabled(false);
window.webContents.setUserAgent(window.webContents.getUserAgent().replaceAll('µPad', 'MicroPad'));

ipcMain.on('initialShouldSpellCheck', (_event, shouldSpellCheck) => {
const appMenu = Menu.buildFromTemplate([
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "micropad",
"version": "4.2.1",
"version": "4.2.8",
"description": "A powerful note-taking app that helps you organise + take notes without restrictions.",
"main": "main.js",
"scripts": {
Expand All @@ -25,9 +25,10 @@
},
"homepage": "https://getmicropad.com",
"devDependencies": {
"@types/mime": "^3.0.1",
"@types/node": "^18.7.18",
"electron": "^23.1.3",
"electron-builder": "^23.6.0",
"electron": "^25.5.0",
"electron-builder": "^24.6.3",
"typescript": "~4.9.5"
},
"dependencies": {
Expand All @@ -36,7 +37,8 @@
"electron-context-menu": "^3.1.2",
"electron-window-state": "^5.0.3",
"localforage": "^1.10.0",
"typo-js": "^1.2.1"
"mime": "^3.0.0",
"typo-js": "^1.2.3"
},
"build": {
"appId": "com.getmicropad.micropad",
Expand Down
Loading

0 comments on commit 9ba1c7f

Please sign in to comment.