Add a hook into the image app that broadcasts when an image is uploaded/updated
This commit is contained in:
parent
2d46160053
commit
2a1f8fd97d
1 changed files with 4 additions and 0 deletions
|
|
@ -114,6 +114,8 @@ export class ImageApp extends
|
|||
path: this.#file ? path : ``,
|
||||
};
|
||||
await uploadJson(`db`, `images.json`, images);
|
||||
|
||||
Hooks.callAll(`${__ID__}.imageUploaded`, hash, images[hash]);
|
||||
}
|
||||
else {
|
||||
const images = await getFile(this.constructor.dbPath);
|
||||
|
|
@ -123,6 +125,8 @@ export class ImageApp extends
|
|||
artists: data.artists,
|
||||
});
|
||||
await uploadJson(`db`, `images.json`, images);
|
||||
|
||||
Hooks.callAll(`${__ID__}.imageUpdated`, this._docID, images[this._docID]);
|
||||
};
|
||||
};
|
||||
// #endregion Lifecycle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue