Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • cf2023-euro
  • cf2023-offline
  • cf2024
  • cf2025
  • main
5 results

Target

Select target project
  • to/cf-online-ui
  • vpfafrin/cf2021
2 results
Select Git revision
  • master
1 result
Show changes
import has from "lodash/has";
import { AuthStore, PostStore } from "stores";
export const handleUserBanned = (payload) => {
AuthStore.update((state) => {
if (state.user && state.user.id && payload.id === state.user.id) {
state.user.isBanned = true;
}
});
PostStore.update((state) => {
Object.keys(state.items).forEach((key) => {
if (state.items[key].author.id === payload.id) {
state.items[key].author.isBanned = true;
}
});
});
};
export const handleUserUnbanned = (payload) => {
AuthStore.update((state) => {
if (state.user && state.user.id && payload.id === state.user.id) {
state.user.isBanned = false;
}
});
PostStore.update((state) => {
Object.keys(state.items).forEach((key) => {
if (state.items[key].author.id === payload.id) {
state.items[key].author.isBanned = false;
}
});
});
};
export const handleUserStatus = (payload) => {
AuthStore.update((state) => {
if (has(payload, "jitsi_allowed")) {
state.showJitsiInvitePopup = payload.jitsi_allowed;
}
});
};
declare namespace CF2021 { declare namespace CF2021 {
export interface GlobalInfoStorePayload {
connectionState: "connected" | "offline" | "connecting";
onlineMembers: number;
onlineUsers: number;
websocketUrl: string;
groupSizeHalf?: number;
streamUrl?: string;
protocolUrl?: string;
protocol?: string;
}
interface ProgramScheduleEntry { interface ProgramScheduleEntry {
id: number; id: number;
number: string; number: string;
title: string; title: string;
fullTitle: string;
proposer: string; proposer: string;
speakers: string;
discussionOpened: boolean; discussionOpened: boolean;
description?: string; description?: string;
htmlContent?: string;
expectedStartAt: Date; expectedStartAt: Date;
expectedFinishAt?: Date; expectedFinishAt?: Date;
} }
...@@ -35,7 +49,15 @@ declare namespace CF2021 { ...@@ -35,7 +49,15 @@ declare namespace CF2021 {
username: string; username: string;
role: "regp" | "member" | "chairman"; role: "regp" | "member" | "chairman";
accessToken: string; accessToken: string;
// These are optional as they're loaded separately.
id?: number;
isBanned?: boolean;
group?: string;
secret?: string;
}; };
showJitsiInvitePopup: boolean;
jitsiPopupDimissed: boolean;
} }
export type AuthStorePayload = export type AuthStorePayload =
...@@ -55,6 +77,7 @@ declare namespace CF2021 { ...@@ -55,6 +77,7 @@ declare namespace CF2021 {
datetime: Date; datetime: Date;
type: AnnouncementType; type: AnnouncementType;
content: string; content: string;
contentHtml: string;
link?: string; link?: string;
relatedPostId: string; relatedPostId: string;
seen: boolean; seen: boolean;
...@@ -77,6 +100,7 @@ declare namespace CF2021 { ...@@ -77,6 +100,7 @@ declare namespace CF2021 {
name: string; name: string;
username: string; username: string;
group: string; group: string;
isBanned: boolean;
}; };
type: PostType; type: PostType;
content: string; content: string;
...@@ -134,8 +158,6 @@ declare namespace CF2021 { ...@@ -134,8 +158,6 @@ declare namespace CF2021 {
window: { window: {
items: string[]; items: string[];
itemCount: number; itemCount: number;
page: number;
perPage: number;
}; };
filters: PostStoreFilters; filters: PostStoreFilters;
} }
......