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
11 changes: 7 additions & 4 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ jobs:
- name: Run Prettier
run: yarn prettier --write .

- name: Run ESLint
run: npx eslint . --fix

- name: Check for changes
id: check_changes
id: changes
run: |
if git diff --quiet; then
echo "No code format changes detected"
Expand All @@ -37,11 +40,11 @@ jobs:
echo "changes=true" >> $GITHUB_OUTPUT
fi

- name: Commit and push changes
if: steps.check_changes.outputs.changes == 'true'
- name: Commit and push eslint changes
if: steps.changes.outputs.changes == 'true'
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add .
git commit -m "chore: format code with Prettier [skip ci]"
git commit -m "chore: format code and fix lint issues [skip ci]"
git push origin ${{ github.ref_name }}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('getMentionRegexpUser', function () {
});

test('removing query text on user suggestion autocomplete (special characters in query)', () => {
const message = "Hey @'=test123";
const message = 'Hey @\'=test123';
expect(message.replace(regexp, '')).toBe('Hey @');
});
});
Expand Down
2 changes: 1 addition & 1 deletion app/containers/UnreadBadge/getUnreadStyle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { themes } from '../../lib/constants/colors';
import { getUnreadStyle } from './getUnreadStyle';

const testsForTheme = theme => {
const testsForTheme = (theme) => {
const getUnreadStyleUtil = ({ ...props }) => getUnreadStyle({ theme, ...props });

test('render empty', () => {
Expand Down
2 changes: 1 addition & 1 deletion app/sagas/createChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const handleRequest = function* handleRequest({ data }) {
const db = database.active;
const subCollection = db.get('subscriptions');
yield db.write(async () => {
await subCollection.create(s => {
await subCollection.create((s) => {
s._raw = sanitizedRaw({ id: sub.rid }, subCollection.schema);
Object.assign(s, sub);
});
Expand Down
2 changes: 1 addition & 1 deletion app/sagas/createDiscussion.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const handleRequest = function* handleRequest({ data }) {
const db = database.active;
const subCollection = db.get('subscriptions');
yield db.write(async () => {
await subCollection.create(s => {
await subCollection.create((s) => {
s._raw = sanitizedRaw({ id: sub.rid }, subCollection.schema);
Object.assign(s, sub);
});
Expand Down
2 changes: 1 addition & 1 deletion app/sagas/deepLinking.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const waitForNavigation = () => {
if (Navigation.navigationRef.current) {
return Promise.resolve();
}
return new Promise(resolve => {
return new Promise((resolve) => {
const listener = () => {
emitter.off('navigationReady', listener);
resolve();
Expand Down
10 changes: 5 additions & 5 deletions app/sagas/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const showSupportedVersionsWarning = function* showSupportedVersionsWarning(serv

const serversDB = database.servers;
yield serversDB.write(async () => {
await serverRecord.update(r => {
await serverRecord.update((r) => {
r.supportedVersionsWarningAt = new Date();
});
});
Expand Down Expand Up @@ -99,7 +99,7 @@ const handleLoginRequest = function* handleLoginRequest({ credentials, logoutOnE
const serverHistoryRecord = serversHistory[0];
// this is updating on every login just to save `updated_at`
// keeping this server as the most recent on autocomplete order
await serverHistoryRecord.update(s => {
await serverHistoryRecord.update((s) => {
s.username = result.username;
});
}
Expand Down Expand Up @@ -252,12 +252,12 @@ const handleLoginSuccess = function* handleLoginSuccess({ user }) {
yield serversDB.write(async () => {
try {
const userRecord = await usersCollection.find(user.id);
await userRecord.update(record => {
await userRecord.update((record) => {
record._raw = sanitizedRaw({ id: user.id, ...record._raw }, usersCollection.schema);
Object.assign(record, u);
});
} catch (e) {
await usersCollection.create(record => {
await usersCollection.create((record) => {
record._raw = sanitizedRaw({ id: user.id }, usersCollection.schema);
Object.assign(record, u);
});
Expand Down Expand Up @@ -341,7 +341,7 @@ const handleSetUser = function* handleSetUser({ user }) {
yield serversDB.write(async () => {
try {
const record = await userCollections.find(userId);
await record.update(userRecord => {
await record.update((userRecord) => {
if ('avatarETag' in user) {
userRecord.avatarETag = user.avatarETag;
}
Expand Down
12 changes: 6 additions & 6 deletions app/sagas/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const updateRooms = function* updateRooms({ server, newRoomsUpdatedAt }) {
const serverRecord = yield serversCollection.find(server);

return serversDB.write(async () => {
await serverRecord.update(record => {
await serverRecord.update((record) => {
record.roomsUpdatedAt = newRoomsUpdatedAt;
});
});
Expand Down Expand Up @@ -75,12 +75,12 @@ const handleRoomsRequest = function* handleRoomsRequest({ params }) {

const allRecords = [
...subsToCreate.map(subscription =>
subCollection.prepareCreate(s => {
subCollection.prepareCreate((s) => {
s._raw = sanitizedRaw({ id: subscription.rid }, subCollection.schema);
return Object.assign(s, subscription);
})
),
...subsToUpdate.map(subscription => {
...subsToUpdate.map((subscription) => {
try {
const newSub = subscriptions.find(s => s._id === subscription._id);
if (!newSub) {
Expand All @@ -99,7 +99,7 @@ const handleRoomsRequest = function* handleRoomsRequest({ params }) {
return null;
}
}),
...subsToDelete.map(subscription => {
...subsToDelete.map((subscription) => {
try {
return subscription.prepareDestroyPermanently();
} catch (e) {
Expand All @@ -108,13 +108,13 @@ const handleRoomsRequest = function* handleRoomsRequest({ params }) {
}
}),
...messagesToCreate.map(message =>
messagesCollection.prepareCreate(m => {
messagesCollection.prepareCreate((m) => {
m._raw = sanitizedRaw({ id: message._id }, messagesCollection.schema);
m.subscription.id = message.rid;
return Object.assign(m, message);
})
),
...messagesToUpdate.map(message => {
...messagesToUpdate.map((message) => {
const newMessage = lastMessages.find(m => m._id === message.id);
return message.prepareUpdate(() => {
try {
Expand Down