|
@@ -1,11 +1,13 @@
|
|
|
import useSWR, { SWRResponse } from 'swr';
|
|
import useSWR, { SWRResponse } from 'swr';
|
|
|
|
|
|
|
|
-import { toastWarning } from '~/client/util/toastr';
|
|
|
|
|
import type { InAppNotificationStatuses, IInAppNotification, PaginateResult } from '~/interfaces/in-app-notification';
|
|
import type { InAppNotificationStatuses, IInAppNotification, PaginateResult } from '~/interfaces/in-app-notification';
|
|
|
import { parseSnapshot } from '~/models/serializers/in-app-notification-snapshot/page';
|
|
import { parseSnapshot } from '~/models/serializers/in-app-notification-snapshot/page';
|
|
|
|
|
+import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
|
|
import { apiv3Get } from '../client/util/apiv3-client';
|
|
import { apiv3Get } from '../client/util/apiv3-client';
|
|
|
|
|
|
|
|
|
|
+const logger = loggerFactory('growi:cli:InAppNotification');
|
|
|
|
|
+
|
|
|
type inAppNotificationPaginateResult = PaginateResult<IInAppNotification>
|
|
type inAppNotificationPaginateResult = PaginateResult<IInAppNotification>
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -23,7 +25,7 @@ export const useSWRxInAppNotifications = <Data, Error>(
|
|
|
doc.snapshot = parseSnapshot(doc.snapshot as string);
|
|
doc.snapshot = parseSnapshot(doc.snapshot as string);
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
- toastWarning(err);
|
|
|
|
|
|
|
+ logger.warn('Failed to parse snapshot', err);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
return inAppNotificationPaginateResult;
|
|
return inAppNotificationPaginateResult;
|