Skip to content

Commit

Permalink
Merge branch 'rebase/jan2024' of https://github.com/shipyard/Rocket.Chat
Browse files Browse the repository at this point in the history
 into rebase/jan2024
  • Loading branch information
nbeck415 committed Jan 18, 2024
2 parents b3d93d9 + c1b04b7 commit 20f96cb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 112 deletions.
3 changes: 0 additions & 3 deletions apps/meteor/app/notifications/client/index.ts

This file was deleted.

102 changes: 0 additions & 102 deletions apps/meteor/app/notifications/client/lib/Notifications.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { IWebdavAccount } from '@rocket.chat/core-typings';
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';

import { WebdavAccounts } from '../../../models/client';
import { Notifications } from '../../../notifications/client';
import { sdk } from '../../../utils/client/lib/SDKClient';

const events = {
changed: (account) => WebdavAccounts.upsert({ _id: account._id }, account),
removed: ({ _id }) => WebdavAccounts.remove({ _id }),
changed: (account: IWebdavAccount) => WebdavAccounts.upsert({ _id: account._id }, account),
removed: ({ _id }: { _id: IWebdavAccount['_id'] }) => WebdavAccounts.remove({ _id }),
};

Tracker.autorun(async () => {
Expand All @@ -16,5 +16,5 @@ Tracker.autorun(async () => {
}
const { accounts } = await sdk.rest.get('/v1/webdav.getMyAccounts');
accounts.forEach((account) => WebdavAccounts.insert(account));
Notifications.onUser('webdav', ({ type, account }) => events[type](account));
sdk.stream('notify-user', [`${Meteor.userId()}/webdav`], ({ type, account }) => events[type](account as IWebdavAccount));
});
1 change: 0 additions & 1 deletion apps/meteor/client/importPackages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import '../app/user-status/client';
import '../app/utils/client';
import '../app/settings/client';
import '../app/models/client';
import '../app/notifications/client';
import '../app/ui-utils/client';
import '../app/ui-cached-collection/client';
import '../app/reactions/client';
Expand Down
4 changes: 2 additions & 2 deletions packages/core-typings/src/IWebdavAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import type { IRocketChatRecord } from './IRocketChatRecord';
export interface IWebdavAccount extends IRocketChatRecord {
userId: string;
serverURL: string;
username?: string;
username: string;
password?: string;
name: string;
}

export type IWebdavAccountIntegration = Pick<IWebdavAccount, '_id' | 'username' | 'serverURL' | 'name'>;

export type IWebdavAccountPayload = Pick<IWebdavAccount, 'serverURL' | 'username' | 'password' | 'name'>;
export type IWebdavAccountPayload = Pick<IWebdavAccount, 'serverURL' | 'password' | 'name'> & Partial<Pick<IWebdavAccount, 'username'>>;

export type IWebdavNode = {
basename: string;
Expand Down

0 comments on commit 20f96cb

Please sign in to comment.