Skip to content

Commit

Permalink
🚑️ Fixed import with Guild (Serverbar)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZickZenni committed Sep 4, 2024
1 parent f7ae178 commit a606457
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/renderer/components/Serverbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useEffect, useState } from 'react';
import './Serverbar.css';
import { Link, useLocation } from 'react-router-dom';
import { Guild } from '../../../common/discord/guild';
import RendererGuild from '../../../discord/structures/guild/RendererGuild';
import { IGuildData } from '../../../discord/structures/guild/BaseGuild';

export default function Serverbar() {
// States
const [guilds, setGuilds] = useState<Guild[]>([]);
const [guilds, setGuilds] = useState<RendererGuild[]>([]);

const location = useLocation();

Expand All @@ -17,15 +18,15 @@ export default function Serverbar() {

if (!ready) return;

const data: Guild[] = await window.electron.ipcRenderer
const data: IGuildData[] = await window.electron.ipcRenderer
.invoke('discord:guilds')
.catch((err) => window.logger.error(err));

window.logger.info(
'Received guilds for server list:',
data.map((v) => `${v.id}`).join(','),
);
setGuilds(data);
setGuilds(data.map((v) => new RendererGuild(v)));
clearInterval(interval);
}, 1000);
return () => {
Expand Down

0 comments on commit a606457

Please sign in to comment.