fix broken webpack finds
This commit is contained in:
		
							parent
							
								
									6f05612e34
								
							
						
					
					
						commit
						4832a9433f
					
				
					 2 changed files with 5 additions and 6 deletions
				
			
		|  | @ -23,7 +23,7 @@ import { findByPropsLazy } from "@webpack"; | ||||||
| import { RestAPI, UserStore } from "@webpack/common"; | import { RestAPI, UserStore } from "@webpack/common"; | ||||||
| 
 | 
 | ||||||
| const FriendInvites = findByPropsLazy("createFriendInvite"); | const FriendInvites = findByPropsLazy("createFriendInvite"); | ||||||
| const uuid = findByPropsLazy("v4", "v1"); | const { uuid4 } = findByPropsLazy("uuid4"); | ||||||
| 
 | 
 | ||||||
| export default definePlugin({ | export default definePlugin({ | ||||||
|     name: "FriendInvites", |     name: "FriendInvites", | ||||||
|  | @ -56,7 +56,7 @@ export default definePlugin({ | ||||||
| 
 | 
 | ||||||
|                 let invite: any; |                 let invite: any; | ||||||
|                 if (uses === 1) { |                 if (uses === 1) { | ||||||
|                     const random = uuid.v4(); |                     const random = uuid4(); | ||||||
|                     const { body: { invite_suggestions } } = await RestAPI.post({ |                     const { body: { invite_suggestions } } = await RestAPI.post({ | ||||||
|                         url: "/friend-finder/find-friends", |                         url: "/friend-finder/find-friends", | ||||||
|                         body: { |                         body: { | ||||||
|  |  | ||||||
|  | @ -20,8 +20,8 @@ import { definePluginSettings } from "@api/Settings"; | ||||||
| import { Devs } from "@utils/constants"; | import { Devs } from "@utils/constants"; | ||||||
| import definePlugin, { OptionType } from "@utils/types"; | import definePlugin, { OptionType } from "@utils/types"; | ||||||
| import { saveFile } from "@utils/web"; | import { saveFile } from "@utils/web"; | ||||||
| import { findByProps, findLazy } from "@webpack"; | import { findByProps } from "@webpack"; | ||||||
| import { Clipboard } from "@webpack/common"; | import { Clipboard, ComponentDispatch } from "@webpack/common"; | ||||||
| 
 | 
 | ||||||
| async function fetchImage(url: string) { | async function fetchImage(url: string) { | ||||||
|     const res = await fetch(url); |     const res = await fetch(url); | ||||||
|  | @ -30,7 +30,6 @@ async function fetchImage(url: string) { | ||||||
|     return await res.blob(); |     return await res.blob(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const MiniDispatcher = findLazy(m => m.emitter?._events?.INSERT_TEXT); |  | ||||||
| 
 | 
 | ||||||
| const settings = definePluginSettings({ | const settings = definePluginSettings({ | ||||||
|     // This needs to be all in one setting because to enable any of these, we need to make Discord use their desktop context
 |     // This needs to be all in one setting because to enable any of these, we need to make Discord use their desktop context
 | ||||||
|  | @ -213,7 +212,7 @@ export default definePlugin({ | ||||||
| 
 | 
 | ||||||
|     cut() { |     cut() { | ||||||
|         this.copy(); |         this.copy(); | ||||||
|         MiniDispatcher.dispatch("INSERT_TEXT", { rawText: "" }); |         ComponentDispatch.dispatch("INSERT_TEXT", { rawText: "" }); | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|     async paste() { |     async paste() { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue