Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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