mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-30 16:10:36 +00:00
lx-music-desktop: update electron to 44 (#576659)
This commit is contained in:
64
pkgs/by-name/lx/lx-music-desktop/electron-44-clipboard.patch
Normal file
64
pkgs/by-name/lx/lx-music-desktop/electron-44-clipboard.patch
Normal file
@@ -0,0 +1,64 @@
|
||||
--- a/src/common/utils/electron.ts
|
||||
+++ b/src/common/utils/electron.ts
|
||||
@@ -24,15 +24,15 @@
|
||||
* 复制文本到剪贴板
|
||||
* @param str
|
||||
*/
|
||||
-export const clipboardWriteText = (str: string) => {
|
||||
- clipboard.writeText(str)
|
||||
+export const clipboardWriteText = (str: string) => {
|
||||
+ void clipboard.writeText(str)
|
||||
}
|
||||
|
||||
/**
|
||||
* 从剪贴板读取文本
|
||||
* @returns
|
||||
*/
|
||||
-export const clipboardReadText = (): string => {
|
||||
+export const clipboardReadText = async (): Promise<string> => {
|
||||
return clipboard.readText()
|
||||
}
|
||||
|
||||
--- a/src/renderer/views/List/MusicList/components/SearchList.vue
|
||||
+++ b/src/renderer/views/List/MusicList/components/SearchList.vue
|
||||
@@ -196,8 +196,8 @@
|
||||
} else return
|
||||
this.$refs.dom_scrollContainer.scrollTo(0, top)
|
||||
},
|
||||
- handleContextMenu() {
|
||||
- let str = clipboardReadText()
|
||||
+ async handleContextMenu() {
|
||||
+ let str = await clipboardReadText()
|
||||
str = str.trim()
|
||||
str = str.replace(/\t|\r\n|\n|\r/g, ' ')
|
||||
str = str.replace(/\s+/g, ' ')
|
||||
--- a/src/renderer/components/material/SearchInput.vue
|
||||
+++ b/src/renderer/components/material/SearchInput.vue
|
||||
@@ -179,8 +179,8 @@
|
||||
this.selectIndex = -1
|
||||
}
|
||||
},
|
||||
- handleContextMenu() {
|
||||
- let str = clipboardReadText()
|
||||
+ async handleContextMenu() {
|
||||
+ let str = await clipboardReadText()
|
||||
str = str.trim()
|
||||
str = str.replace(/\t|\r\n|\n|\r/g, ' ')
|
||||
str = str.replace(/\s+/g, ' ')
|
||||
--- a/src/renderer/components/base/Input.vue
|
||||
+++ b/src/renderer/components/base/Input.vue
|
||||
@@ -65,12 +65,12 @@
|
||||
focus() {
|
||||
this.$refs.dom_input.focus()
|
||||
},
|
||||
- handleContextMenu(event) {
|
||||
+ async handleContextMenu(event) {
|
||||
if (this.stopContentEventPropagation) event.stopPropagation()
|
||||
if (!this.autoPaste) return
|
||||
let dom_input = this.$refs.dom_input
|
||||
if (dom_input.selectionStart === null) return
|
||||
- let str = clipboardReadText()
|
||||
+ let str = await clipboardReadText()
|
||||
str = str.trim()
|
||||
str = str.replace(/\t|\r\n|\n|\r/g, ' ')
|
||||
str = str.replace(/\s+/g, ' ')
|
||||
35
pkgs/by-name/lx/lx-music-desktop/electron-version.patch
Normal file
35
pkgs/by-name/lx/lx-music-desktop/electron-version.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -123,7 +123,7 @@
|
||||
"css-loader": "^7.1.5",
|
||||
"css-minimizer-webpack-plugin": "^8.0.0",
|
||||
"del": "^6.1.1",
|
||||
- "electron": "42.11.6",
|
||||
+ "electron": "44.9.1",
|
||||
"electron-builder": "^26.15.7",
|
||||
"electron-debug": "^3.2.0",
|
||||
"electron-devtools-installer": "github:lyswhut/electron-devtools-installer#64596d615c1fc891eefd8aef1dfcb2c87aaadf03",
|
||||
--- a/package-lock.json
|
||||
+++ b/package-lock.json
|
||||
@@ -50,7 +50,7 @@
|
||||
"css-loader": "^7.1.5",
|
||||
"css-minimizer-webpack-plugin": "^8.0.0",
|
||||
"del": "^6.1.1",
|
||||
- "electron": "42.11.6",
|
||||
+ "electron": "44.9.1",
|
||||
"electron-builder": "^26.15.7",
|
||||
"electron-debug": "^3.2.0",
|
||||
"electron-devtools-installer": "github:lyswhut/electron-devtools-installer#64596d615c1fc891eefd8aef1dfcb2c87aaadf03",
|
||||
@@ -5396,9 +5396,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/electron": {
|
||||
- "version": "42.11.6",
|
||||
- "resolved": "https://registry.npmjs.org/electron/-/electron-42.11.6.tgz",
|
||||
- "integrity": "sha512-IgDsjQp+CYLnArfQbzzS2VmkRgHmSU1G9nGVOtSnFpkUYR8rkeAUSDO77qtqAPX1jgAGly1kgisUmwB9CbUHXw==",
|
||||
+ "version": "44.9.1",
|
||||
+ "resolved": "https://registry.npmjs.org/electron/-/electron-44.9.1.tgz",
|
||||
+ "integrity": "sha512-x/tECFFDa2OFNjMObFH0EGKWrCnFZPOR1wP2iMIVt0STecGl8FmDXdaiaryY0kf8mtw9kSLP2yK8dfdaWkfDmw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -10,12 +10,12 @@
|
||||
makeWrapper,
|
||||
makeDesktopItem,
|
||||
|
||||
electron_42,
|
||||
electron_44,
|
||||
commandLineArgs ? "",
|
||||
}:
|
||||
|
||||
let
|
||||
electron = electron_42;
|
||||
electron = electron_44;
|
||||
in
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "lx-music-desktop";
|
||||
@@ -51,6 +51,10 @@ buildNpmPackage (finalAttrs: {
|
||||
];
|
||||
|
||||
patches = [
|
||||
# the upstream use an EOL electron version
|
||||
./electron-version.patch
|
||||
# clipboard APIs are async since electron 44
|
||||
./electron-44-clipboard.patch
|
||||
# set electron version and dist dir
|
||||
# disable before-pack: it would copy prebuilt libraries
|
||||
(replaceVars ./electron-builder.patch {
|
||||
@@ -63,7 +67,7 @@ buildNpmPackage (finalAttrs: {
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
npmDepsHash = "sha256-bBgewJxBSzyL1V9U9qm0TbWCZMjheCUK6DvvoE3T67M=";
|
||||
npmDepsHash = "sha256-LF/E7JJZQQzEHTEQeFiYa1eMeV+OrqK+8ktwhTmRY30=";
|
||||
|
||||
makeCacheWritable = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user