mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-24 06:32:08 -05:00
fix: update draft check (#830)
This commit is contained in:
parent
fcf6812151
commit
dadf0b6329
1 changed files with 6 additions and 4 deletions
|
@ -59,10 +59,12 @@ export default class Draft implements Store, Persistent<Data> {
|
|||
* @param channel Channel ID
|
||||
*/
|
||||
@computed has(channel: string) {
|
||||
return (
|
||||
this.drafts.has(channel) &&
|
||||
this.drafts.get(channel)!.content!.length > 0
|
||||
);
|
||||
if (!this.drafts.has(channel)) return false;
|
||||
// fetch the draft object
|
||||
const potentialDraft = this.drafts.get(channel)?.content;
|
||||
// if it doesn't have any content return false
|
||||
if (!potentialDraft) return false;
|
||||
return potentialDraft.length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue