DasSauerkraut / calendar-weather

A module for FoundryVTT that adds a calendar widget with weather, moons cycles, and a customizable calendar.
Apache License 2.0
19 stars 26 forks source link

Can't update date, "Unexpected token o in JSON at position 1" #167

Closed MarlQ closed 4 years ago

MarlQ commented 4 years ago

Current foundry version: 0.7.5 I can not edit the date in any way, trying to save throws the following error: 2020_10_31_17_30_57_FoundryVTT_Foundry_Virtual_Tabletop_•_A_Standalone_Virtual_Ta

I actually fixed this issue by changing in init.mjs

Hooks.on('calendarSettingsClose', (updatedData) => {
    console.log("calendar-weather | Closing Calendar form.");
    console.log(updatedData)
    c.rebuild(JSON.parse(updatedData));
    cwdtData.dt.genDateWordy();
    c.updateDisplay();
    c.updateSettings();
    c.settingsOpen(false);
  });

to

  Hooks.on('calendarSettingsClose', async (updatedData) => {
    console.log("calendar-weather | Closing Calendar form.");
    updatedData = await updatedData;
    console.log(updatedData)
    c.rebuild(JSON.parse(updatedData));
    cwdtData.dt.genDateWordy();
    c.updateDisplay();
    c.updateSettings();
    c.settingsOpen(false);
  });
MarlQ commented 4 years ago

Ok, nevermind. It broke again. No error messages anymore. Yet I can't update the date or time from the configuration menu anymore.

Edit: Undoing the change fixed it again... somewhat. The module seems to occasionally freak out completely, changing number wildly and even spamming chat with weather changes

geoidesic commented 4 years ago

Fixed in this PR #163