Skip to content

Add ChannelPage and use it instead of returning a tuple like Array.#76

Merged
tudddorrr merged 1 commit into
TaloDev:developfrom
Daylily-Zeleen:channel_page
Feb 26, 2025
Merged

Add ChannelPage and use it instead of returning a tuple like Array.#76
tudddorrr merged 1 commit into
TaloDev:developfrom
Daylily-Zeleen:channel_page

Conversation

@Daylily-Zeleen
Copy link
Copy Markdown
Contributor

A part of #70 .

@Daylily-Zeleen Daylily-Zeleen changed the title Add ChannelPage and use it instead of return a tuple like Array. Add ChannelPage and use it instead of returning a tuple like Array. Feb 25, 2025
@Daylily-Zeleen Daylily-Zeleen force-pushed the channel_page branch 2 times, most recently from e92cfa5 to 82ea9f0 Compare February 25, 2025 15:21
var res = await Talo.channels.get_channels(0)
var channels = res[0]
assert(is_instance_valid(res))
var channels = res.channels
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there some GDScript limitation here where async code doesn't pass through the correct type? hovering over res I don't see that its a ChannelPage

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GDScript can infer the return value type of async method with await. The type of res just not be inferred here.
Use ":=" instead of "=" can solve it.

But this is a type safe issue, it can be handled with other untyped code in an independent pr.

Comment thread addons/talo/apis/channels_api.gd Outdated
Comment on lines +150 to +151
self.channels = p_channels
self.count = p_count
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll need to update these variable names to remove the p_ prefix (to match the params)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already fix now.

@tudddorrr tudddorrr added the enhancement New feature or request label Feb 26, 2025
@tudddorrr tudddorrr merged commit e0537ca into TaloDev:develop Feb 26, 2025
@Daylily-Zeleen Daylily-Zeleen deleted the channel_page branch February 28, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants