Fix NoScreensharePreview

This commit is contained in:
Vendicated 2023-10-26 00:20:56 +02:00
parent 96dff84ed8
commit 45fa4f89c6
No known key found for this signature in database
GPG Key ID: D66986BAF75ECF18

@ -25,14 +25,11 @@ export default definePlugin({
authors: [Devs.Nuckyz], authors: [Devs.Nuckyz],
patches: [ patches: [
{ {
find: '("ApplicationStreamPreviewUploadManager")', find: '"ApplicationStreamPreviewUploadManager"',
replacement: [ replacement: {
String.raw`\i\.\i\.makeChunkedRequest\(`, match: /await \i\.\i\.(makeChunkedRequest\(|post\(\{url:)\i\.\i\.STREAM_PREVIEW.+?\}\)/g,
String.raw`\i\.\i\.post\({url:` replace: "0"
].map(match => ({ }
match: new RegExp(String.raw`(?=return\[(\d),${match}\i\.\i\.STREAM_PREVIEW.+?}\)\];)`),
replace: (_, code) => `return[${code},Promise.resolve({body:"",status:204})];`
}))
} }
] ]
}); });