Browse Source

id 使用action name

liwei 1 năm trước cách đây
mục cha
commit
37ca2588b4
1 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 5 4
      src/comm/controllers/appMsgRecvCtrl.ts

+ 5 - 4
src/comm/controllers/appMsgRecvCtrl.ts

@@ -9,11 +9,12 @@ export type AssetSendedCallback = (assetUri:string)=>Promise<boolean>;
 export type AssetType = "empty" | "image"
 const RevcChangeEvent = "app.recv.change"
 class AssetListener {
-    id = nanoid();
+    id = "";
     type = "empty" as AssetType;
-
-    constructor(public actionName:string, public callback: AssetSendedCallback){}
-
+    constructor(public actionName:string, public callback: AssetSendedCallback){
+        this.id = actionName;
+    }
+    
     toJson() {
         return {
             id: this.id,