mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-16 09:31:50 +02:00
✨ Allow users to customize poll behaviour (#785)
This commit is contained in:
parent
14cfa2bd50
commit
b1e3f63a2e
58 changed files with 1361 additions and 1042 deletions
|
@ -180,7 +180,7 @@ export const DayjsProvider: React.FunctionComponent<{
|
|||
const localeConfig = dayjsLocales[router.locale ?? "en"];
|
||||
const { data } = trpc.userPreferences.get.useQuery();
|
||||
|
||||
useAsync(async () => {
|
||||
const state = useAsync(async () => {
|
||||
const locale = await localeConfig.import();
|
||||
const localeTimeFormat = localeConfig.timeFormat;
|
||||
const timeFormat = data?.timeFormat ?? localeConfig.timeFormat;
|
||||
|
@ -205,6 +205,11 @@ export const DayjsProvider: React.FunctionComponent<{
|
|||
|
||||
const preferredTimeZone = data?.timeZone ?? locale.timeZone;
|
||||
|
||||
if (state.loading) {
|
||||
// wait for locale to load before rendering
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<DayjsContext.Provider
|
||||
value={{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue