Skip to content

fix(PinDMs): display properly when there are 0 unpinned dms#2281

Merged
Vendicated merged 10 commits into
Vendicated:devfrom
Syncxv:fix-pin-dms-and-improvments
Mar 28, 2024
Merged

fix(PinDMs): display properly when there are 0 unpinned dms#2281
Vendicated merged 10 commits into
Vendicated:devfrom
Syncxv:fix-pin-dms-and-improvments

Conversation

@Syncxv
Copy link
Copy Markdown
Contributor

@Syncxv Syncxv commented Mar 22, 2024

When you add all your dms to a category it causes everything to disappear. This happens because of this:

return channelIds.length ? this.getSections() : [];

this line of code assumes an empty channelIds means dms havent been fetched from discord, but it doenst account for the case where dms have been fetched and all the private dms have been added to one or more categories.

@Nuckyz
Copy link
Copy Markdown
Collaborator

Nuckyz commented Mar 22, 2024

Can you also add a convertion from the old setting that sorted by last message? Currently it is needed to re-enable it manually

@Syncxv
Copy link
Copy Markdown
Contributor Author

Syncxv commented Mar 22, 2024

done

Comment thread src/plugins/pinDms/index.tsx Outdated
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
@Vendicated
Copy link
Copy Markdown
Owner

this still seems to rely on length. what happens if you use this on an account with 0 dms?

@Vendicated Vendicated changed the title Fix PinDMs fix PinDMs: display properly when there are 0 unpinned channels Mar 22, 2024
@Vendicated Vendicated changed the title fix PinDMs: display properly when there are 0 unpinned channels fix PinDMs: display properly when there are 0 unpinned dms Mar 22, 2024
@Vendicated Vendicated changed the title fix PinDMs: display properly when there are 0 unpinned dms fix(PinDMs): display properly when there are 0 unpinned dms Mar 22, 2024
@Syncxv
Copy link
Copy Markdown
Contributor Author

Syncxv commented Mar 23, 2024

i dont think we need to check if its initialized.

startAt: StartAt.WebpackReady,
start: init,
flux: {
CONNECTION_OPEN: init,
},

export async function init() {
const id = UserStore.getCurrentUser()?.id;
await initCategories(id);
await migrateData(id);
forceUpdate();
}

the init function forceUpdates the component on connection open (when channels have been fetched), meaning that check is kinda useless.

@Vendicated Vendicated merged commit 650f405 into Vendicated:dev Mar 28, 2024
@Vendicated
Copy link
Copy Markdown
Owner

thanks!

lillithrosepup pushed a commit to lillithrosepup/Vencord that referenced this pull request May 27, 2024
…ed#2281)

Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Co-authored-by: V <vendicated@riseup.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants