fix bugs with calendar page, highlight next event

This commit is contained in:
marlon-erler
2026-09-25 19:57:35 +02:00
parent 58d64858db
commit bdbd5fa123
15 changed files with 411 additions and 296 deletions
+4 -11
View File
@@ -59,7 +59,6 @@ export default class CoreViewModel {
if (!(e instanceof KeyboardEvent))
return console.trace("NOT A KEY EVENT");
if (CoreViewModel.checkIsKeystroke(e) == false) return;
console.log(e.key);
e.preventDefault();
const contexts: Context[] = this.contexts;
while (contexts.length > 0) {
@@ -73,24 +72,21 @@ export default class CoreViewModel {
// CHRON
chronHandlerManager = new HandlerManager<void>();
todayDate = new React.State<Date>(new Date());
time = new React.State<[number, number]>([0, 0]);
time = new React.State<string>("99:99");
get unwrappedTodayDate(): Date {
return new Date(this.todayDate.value);
}
get timeString(): string {
return this.time.value.join(":");
}
startChron = (): void => {
setInterval(this.chronHandlerManager.trigger, 2000);
setInterval(this.chronHandlerManager.trigger, 1000);
};
handleChron = (): void => {
const newDate = new Date();
if (this.unwrappedTodayDate.toDateString() != newDate.toDateString())
this.todayDate.value = new Date();
if (formatTime(newDate) != this.timeString)
this.time.value = [newDate.getHours(), newDate.getMinutes()];
if (formatTime(newDate) != this.time.value)
this.time.value = formatTime(newDate);
};
// DRAG & DROP
@@ -154,9 +150,6 @@ export default class CoreViewModel {
this.configureServiceWorker();
this.checkUpdates();
this.noUpdateAvailable.subscribe(() => {
console.log(this.noUpdateAvailable.value, this.latestVersion.value, this.version.value);
})
this.startChron();
this.chronHandlerManager.setHandler(
@@ -7,6 +7,7 @@ import StorageModel, {
} from "../../Model/Global/storageModel";
import { TransferData } from "../../Model/Global/fileTransferModel";
import ChatModel from "../../Model/Chat/chatModel";
import {formatISO} from "../../Model/Utility/utility";
export default class FileTransferViewModel extends Context {
// state
@@ -142,7 +143,7 @@ export default class FileTransferViewModel extends Context {
downloadFile = async (): Promise<void> => {
if (this.cannotExport.value == true) return;
const date = new Date().toISOString().split("T")[0];
const date = formatISO(new Date());
const backup: Blob =
await this.coreViewModel.fileTransferModel.generateBackup(
@@ -35,7 +35,6 @@ export default class NotificationViewModel {
openNotification = () => {
const notification: Notification | undefined = this.marquee.value;
console.log(notification);
if (notification == undefined) return;
const chat = [
-1
View File
@@ -52,7 +52,6 @@ export default class StorageViewModel extends Context {
calculateUsage = (): void => {
this.occupiedSpaceMB.value = this.coreViewModel.storageModel.calculateUsage();
this.maximumSpaceMB.value = this.coreViewModel.storageModel.determineCapacity();
console.log(this.occupiedSpaceMB.value, this.maximumSpaceMB.value);
}
// view