Skip to content

Commit

Permalink
fix: initial stuck client if root_url is wrong (#30913)
Browse files Browse the repository at this point in the history
  • Loading branch information
debdutdeb authored Dec 8, 2023
1 parent 715328b commit 79029f0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions apps/meteor/server/startup/initialData.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,36 @@ import { validateEmail } from '../../lib/emailValidator';
import { addUserRolesAsync } from '../lib/roles/addUserRoles';

Meteor.startup(async () => {
const dynamicImport = {
'dynamic-import': {
useLocationOrigin: true,
},
};

if (!Meteor.settings) {
Meteor.settings = {
public: {
packages: {
'dynamic-import': dynamicImport,
},
},
};
}

if (!Meteor.settings.public) {
Meteor.settings.public = {
packages: {
'dynamic-import': dynamicImport,
},
};
}

if (!Meteor.settings.public.packages) {
Meteor.settings.public.packages = dynamicImport;
}

Meteor.settings.public.packages['dynamic-import'] = dynamicImport['dynamic-import'];

if (!settings.get('Initial_Channel_Created')) {
const exists = await Rooms.findOneById('GENERAL', { projection: { _id: 1 } });
if (!exists) {
Expand Down

0 comments on commit 79029f0

Please sign in to comment.