Skip to content

[API Bug] Strange empty state flickering #221

@tonka3000

Description

@tonka3000

I have troubles with empty state flickering in my twitter extension. Usually I try to keep isLoading true as long as I have data and this works great. But in my twitter extension there seems to be some kind of race condition and I'm not 100% sure if this is a bug in my extension or in raycast itself. Maybe this is also intentional.

Raycast version: 1.25.1

Steps To Reproduce

  1. Start Recent Tweets command
  2. Before the list get rendered the no result view pop up for under a second.
CleanShot.2021-10-25.at.16.25.01.mp4

The current behavior

The code is here

I've added some console.log calls in the screenshot.

image

Here is the log

CleanShot 2021-10-25 at 16 08 35@2x

In the first render cycle the data is undefined and isLoading is true.

In the second render cycle the data has the correct content and isLoading is still true.

In the third render cycle the data has the correct content and isLoading is false.

I always thought that as long as isLoading is true in the beginning no no result view will pop up. My problem is that just checking for data === undefined for isLoading is not enough in my case because I support manual reload of the content.

The expected behavior

As long as isLoading is true on the first start there should be no no result view.

Metadata

Metadata

Assignees

Labels

apiIssues related to APIbugSomething isn't workingstatus: fixed in next releaseThe issue will be closed once next release is available

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions