diff --git a/src/App/Actions/IOActions.ts b/src/App/Actions/IOActions.ts index e50aba25..f19cdf6b 100644 --- a/src/App/Actions/IOActions.ts +++ b/src/App/Actions/IOActions.ts @@ -6,7 +6,7 @@ import { UpdateInfo } from "electron-updater"; import * as fs from "fs"; import { extname, join } from "path"; import { toMsg, tryIO } from "../../Control/Exception"; -import { bimap, Either, either, eitherToMaybe, first, fromLeft, fromLeft_, fromRight_, isLeft, isRight, Left, Right } from "../../Data/Either"; +import { bimap, Either, either, eitherToMaybe, first, fromLeft_, fromRight_, isLeft, isRight, Left, Right } from "../../Data/Either"; import { flip } from "../../Data/Function"; import { fmap, fmapF } from "../../Data/Functor"; import { over } from "../../Data/Lens"; @@ -119,8 +119,8 @@ export const requestInitialData: ReduxAction> = async dispatch => } else { dispatch (addAlert ({ - title: fst (data), - message: fromLeft ("") (snd (data)), + title: fst (fromLeft_ (data)), + message: snd (fromLeft_ (data)), })) } }) @@ -135,14 +135,14 @@ export const getInitialData: ReduxAction, In const deleted = await deleteCache () if (isLeft (deleted)) { - return first (toMsg) (deleted) + return first (pipe (toMsg, Pair ("Error"))) (deleted) } } const update_written = await writeUpdate (false) if (isLeft (update_written)) { - return first (toMsg) (update_written) + return first (pipe (toMsg, Pair ("Error"))) (update_written) } // parsing error inside, missing file outside @@ -160,12 +160,7 @@ export const getInitialData: ReduxAction, In console.error (`Config parse error: ${msg}`) - dispatch (addAlert ({ - message: msg, - title: "Error", - })) - - return Left (msg) + return Left (Pair ("Config Error", msg)) } const mconfig = eitherToMaybe (fromRight_ (eeconfig_flipped)) @@ -181,12 +176,7 @@ export const getInitialData: ReduxAction, In return bimap ((msg: string) => { console.error (`Table parse error: ${msg}`) - dispatch (addAlert ({ - message: msg, - title: "Error", - })) - - return msg + return Pair ("Database Error", msg) }) ((tables: TableParseRes): InitialData => ({ diff --git a/src/App/Utilities/Raw/JSON/Generic.ts b/src/App/Utilities/Raw/JSON/Generic.ts index 10ae1033..a05bd87e 100644 --- a/src/App/Utilities/Raw/JSON/Generic.ts +++ b/src/App/Utilities/Raw/JSON/Generic.ts @@ -97,9 +97,12 @@ export const fromJSEnum = export const fromJSEnumM = (enum_name: string) => (enum_values: A) => - fromJS ((x): x is EnsureEnumType | undefined => (isString (x) || isNumber (x)) - && isInEnum (enum_values) - (x as GenericEnumType)) + fromJS ((x): x is EnsureEnumType | undefined => ( + (isString (x) || isNumber (x)) + && isInEnum (enum_values) + (x as GenericEnumType) + ) + || x === undefined) >> (Maybe) (enum_name) diff --git a/src/App/Views/Sheets/BelongingsSheet/BelongingsSheet.scss b/src/App/Views/Sheets/BelongingsSheet/BelongingsSheet.scss index 16ec29c2..55777d5d 100644 --- a/src/App/Views/Sheets/BelongingsSheet/BelongingsSheet.scss +++ b/src/App/Views/Sheets/BelongingsSheet/BelongingsSheet.scss @@ -69,7 +69,7 @@ label { display: block; - width: 32mm; + width: 31mm; font: bold 10px/9mm Alegreya SC; color: black; padding: 0; @@ -121,7 +121,6 @@ &.money .box { height: 4mm; - text-align: center; } &.specifics .box { diff --git a/src/App/Views/Sheets/BelongingsSheet/BelongingsSheetItemsColumn.tsx b/src/App/Views/Sheets/BelongingsSheet/BelongingsSheetItemsColumn.tsx index 42eb894f..4c22ac94 100644 --- a/src/App/Views/Sheets/BelongingsSheet/BelongingsSheetItemsColumn.tsx +++ b/src/App/Views/Sheets/BelongingsSheet/BelongingsSheetItemsColumn.tsx @@ -30,7 +30,7 @@ export function BelongingsSheetItemsColumn (props: BelongingsSheetItemsColumnPro {translate (l10n) ("item")} - {translate (l10n) ("number")} + {translate (l10n) ("number.short")} {translate (l10n) ("price")} @@ -83,11 +83,11 @@ export function BelongingsSheetItemsColumn (props: BelongingsSheetItemsColumnPro {replicateR (columnSize - flength (items)) (index => ( - - - - - + + + + + ))}