mirror of
https://github.com/atuinsh/atuin.git
synced 2025-02-13 09:00:52 +01: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[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs));
|
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 { invoke } from "@tauri-apps/api/core";
|
||||||
import { sessionToken, settings } from "./client";
|
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
|
// I'll probs want to slice this up at some point, but for now a
|
||||||
// big blobby lump of state is fine.
|
// big blobby lump of state is fine.
|
||||||
@ -47,8 +48,7 @@ let state = (set: any, get: any): AtuinState => ({
|
|||||||
shellHistory: [],
|
shellHistory: [],
|
||||||
calendar: [],
|
calendar: [],
|
||||||
|
|
||||||
// @ts-ignore
|
weekStart: getWeekInfo().firstDay,
|
||||||
weekStart: new Intl.Locale(navigator.language).getWeekInfo().firstDay,
|
|
||||||
|
|
||||||
refreshAliases: () => {
|
refreshAliases: () => {
|
||||||
invoke("aliases").then((aliases: any) => {
|
invoke("aliases").then((aliases: any) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user