mirror of
https://github.com/ellie/atuin.git
synced 2024-09-11 21:18:22 +03:00
fix(gui): weekInfo call on Edge (#2252)
This commit is contained in:
parent
35bbaea0e4
commit
69def05f75
@ -29,3 +29,20 @@ const twMerge = extendTailwindMerge({
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
// edge still uses the old one
|
||||
export function getWeekInfo() {
|
||||
let locale = new Intl.Locale(navigator.language);
|
||||
|
||||
// @ts-ignore
|
||||
if (locale.getWeekInfo) {
|
||||
// @ts-ignore
|
||||
return locale.getWeekInfo();
|
||||
// @ts-ignore
|
||||
} else if (locale.weekInfo) {
|
||||
// @ts-ignore
|
||||
return locale.weekInfo;
|
||||
}
|
||||
|
||||
throw new Error("Could not fetch week info via new or old api");
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import {
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { sessionToken, settings } from "./client";
|
||||
import { getWeekInfo } from "@/lib/utils";
|
||||
|
||||
// I'll probs want to slice this up at some point, but for now a
|
||||
// big blobby lump of state is fine.
|
||||
@ -47,8 +48,7 @@ let state = (set: any, get: any): AtuinState => ({
|
||||
shellHistory: [],
|
||||
calendar: [],
|
||||
|
||||
// @ts-ignore
|
||||
weekStart: new Intl.Locale(navigator.language).getWeekInfo().firstDay,
|
||||
weekStart: getWeekInfo().firstDay,
|
||||
|
||||
refreshAliases: () => {
|
||||
invoke("aliases").then((aliases: any) => {
|
||||
|
Loading…
Reference in New Issue
Block a user