Skip to content

Commit

Permalink
adjust meteor code to 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Jan 12, 2024
1 parent a1ef5c3 commit db0c0d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
33 changes: 15 additions & 18 deletions apps/meteor/packages/flow-router/.npm/package/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apps/meteor/server/lib/getMomentLocale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ export async function getMomentLocale(locale: string): Promise<string | undefine
const localeLower = locale.toLowerCase();

try {
return Assets.getTextAsync(`moment-locales/${localeLower}.js`);
return Assets.getText(`moment-locales/${localeLower}.js`);
} catch (error) {
try {
return Assets.getTextAsync(`moment-locales/${String(localeLower.split('-').shift())}.js`);
return Assets.getText(`moment-locales/${String(localeLower.split('-').shift())}.js`);
} catch (error) {
throw new Meteor.Error('moment-locale-not-found', `Moment locale not found: ${locale}`);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/server/routes/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const i18nHandler = async function (req: IncomingMessage, res: ServerResponse) {
const { lng } = match.params;

try {
const data = await Assets.getTextAsync(`i18n/${lng}.i18n.json`);
const data = await Assets.getText(`i18n/${lng}.i18n.json`);
if (!data) {
throw new Error();
}
Expand Down

0 comments on commit db0c0d9

Please sign in to comment.