feat: add warning toast if the api returns no comments
This commit is contained in:
1 parent
dffa10aee7
commit
daff5f2c09
1 file changed
+12
@@ -69,9 +69,21 @@
|
||||
if (treeParent) {
|
||||
// < 0.18.3
|
||||
parent.children = treeParent.children
|
||||
if (treeParent.children.length == 0) {
|
||||
toast({
|
||||
content: 'The API returned no comments.',
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// 0.18.3+
|
||||
parent.children = tree
|
||||
if (tree.length == 0) {
|
||||
toast({
|
||||
content: 'The API returned no comments.',
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
Reference in new issue
Block a user