mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
fix: update draft check
This commit is contained in:
@@ -59,10 +59,12 @@ export default class Draft implements Store, Persistent<Data> {
|
|||||||
* @param channel Channel ID
|
* @param channel Channel ID
|
||||||
*/
|
*/
|
||||||
@computed has(channel: string) {
|
@computed has(channel: string) {
|
||||||
return (
|
if (!this.drafts.has(channel)) return false;
|
||||||
this.drafts.has(channel) &&
|
// fetch the draft object
|
||||||
this.drafts.get(channel)!.content!.length > 0
|
const potentialDraft = this.drafts.get(channel)?.content;
|
||||||
);
|
// if it doesn't have any content return false
|
||||||
|
if (!potentialDraft) return false;
|
||||||
|
return potentialDraft.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user