Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some typos #1038

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/domain/RootViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class RootViewModel extends ViewModel {
defaultHomeserver: this.platform.config["defaultHomeServer"],
ready: client => {
// we don't want to load the session container again,
// but we also want the change of screen to go through the navigation
// but we also want the change of screen to go through the navigation,
// so we store the session container in a temporary variable that will be
// consumed by _applyNavigation, triggered by the navigation change
//
Expand Down
2 changes: 1 addition & 1 deletion src/domain/login/LoginViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class LoginViewModel extends ViewModel<SegmentType, Options> {
// we don't need to reset things again here.
// However, clear things set by setHomeserver:
// if query is called before the typing timeout hits (e.g. field lost focus),
// cancel the timeout so we don't query again.
// cancel the timeout, so we don't query again.
this._abortHomeserverQueryTimeout = this.disposeTracked(this._abortHomeserverQueryTimeout);
// cancel ongoing query operation, if any
this._abortQueryOperation = this.disposeTracked(this._abortQueryOperation);
Expand Down
2 changes: 1 addition & 1 deletion src/domain/navigation/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class Path<T> {
}
index -= 1;
} while(index >= -1);
// allow -1 as well so we check if the segment is allowed as root
// allow -1 as well, so we check if the segment is allowed as root
return undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion src/domain/navigation/URLRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class URLRouter<T extends {session: string | boolean}> implements IURLRou
}

openRoomActionUrl(roomId: string): string {
// not a segment to navigation knowns about, so append it manually
// not a segment to navigation knows about, so append it manually
const urlPath = `${this._stringifyPath(this._navigation.path.until("session"))}/open-room/${encodeURIComponent(roomId)}`;
return this._history.pathAsUrl(urlPath);
}
Expand Down
24 changes: 12 additions & 12 deletions src/domain/session/RoomGridViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ export class RoomGridViewModel extends ViewModel {
/** called from SessionViewModel */
initializeRoomIdsAndTransferVM(roomIds, existingRoomVM) {
roomIds = dedupeSparse(roomIds);
let transfered = false;
let transferred = false;
if (existingRoomVM) {
const index = roomIds.indexOf(existingRoomVM.id);
if (index !== -1) {
this._viewModelsObservables[index] = this.track(existingRoomVM);
existingRoomVM.subscribe(viewModel => this._refreshRoomViewModel(viewModel));
transfered = true;
transferred = true;
}
}
this.setRoomIds(roomIds);
Expand All @@ -119,7 +119,7 @@ export class RoomGridViewModel extends ViewModel {
this._selectedIndex = index;
}
}
return transfered;
return transferred;
}

/** called from SessionViewModel */
Expand Down Expand Up @@ -256,8 +256,8 @@ export function tests() {
height: 2,
});
const existingRoomVM = new RoomViewModelObservableMock(new RoomVMMock("a"));
const transfered = gridVM.initializeRoomIdsAndTransferVM(navigation.path.get("rooms").value, existingRoomVM);
assert.equal(transfered, true);
const transferred = gridVM.initializeRoomIdsAndTransferVM(navigation.path.get("rooms").value, existingRoomVM);
assert.equal(transferred, true);
assert.equal(gridVM.focusIndex, 0);
assert.equal(gridVM.roomViewModelAt(0).id, "a");
},
Expand All @@ -270,8 +270,8 @@ export function tests() {
height: 2,
});
const existingRoomVM = new RoomViewModelObservableMock(new RoomVMMock("f"));
const transfered = gridVM.initializeRoomIdsAndTransferVM(navigation.path.get("rooms").value, existingRoomVM);
assert.equal(transfered, false);
const transferred = gridVM.initializeRoomIdsAndTransferVM(navigation.path.get("rooms").value, existingRoomVM);
assert.equal(transferred, false);
assert.equal(gridVM.focusIndex, 0);
assert.equal(gridVM.roomViewModelAt(0).id, "a");
},
Expand All @@ -283,13 +283,13 @@ export function tests() {
width: 3,
height: 2,
});
const transfered = gridVM.initializeRoomIdsAndTransferVM(navigation.path.get("rooms").value);
assert.equal(transfered, false);
const transferred = gridVM.initializeRoomIdsAndTransferVM(navigation.path.get("rooms").value);
assert.equal(transferred, false);
const releasedVM = gridVM.releaseRoomViewModel("a");
gridVM.dispose();
assert.equal(releasedVM.get().disposed, false);
},
"transfered & released room view model is not disposed": assert => {
"transferred & released room view model is not disposed": assert => {
const navigation = createNavigationForRoom([undefined, "a"], "a");
const gridVM = new RoomGridViewModel({
createRoomViewModelObservable: () => assert.fail("no vms should be created"),
Expand All @@ -298,8 +298,8 @@ export function tests() {
height: 2,
});
const existingRoomVM = new RoomViewModelObservableMock(new RoomVMMock("a"));
const transfered = gridVM.initializeRoomIdsAndTransferVM(navigation.path.get("rooms").value, existingRoomVM);
assert.equal(transfered, true);
const transferred = gridVM.initializeRoomIdsAndTransferVM(navigation.path.get("rooms").value, existingRoomVM);
assert.equal(transferred, true);
const releasedVM = gridVM.releaseRoomViewModel("a");
gridVM.dispose();
assert.equal(releasedVM.get().disposed, false);
Expand Down
2 changes: 1 addition & 1 deletion src/domain/session/room/RoomViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class RoomViewModel extends ErrorReportViewModel {
if (!this.features.calls) {
return;
}
// pick call for this room with lowest key
// pick call for this room with the lowest key
const calls = this.getOption("session").callHandler.calls;
this._callObservable = new PickMapObservableValue(calls.filterValues(c => {
return c.roomId === this._room.id && c.hasJoined;
Expand Down
4 changes: 2 additions & 2 deletions src/domain/session/room/UnknownRoomViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export class UnknownRoomViewModel extends ViewModel {
this.emitChange("busy");
try {
const roomId = await this._session.joinRoom(this.roomIdOrAlias);
// navigate to roomId if we were at the alias
// so we're subscribed to the right room status
// navigate to roomId if we were at the alias,
// so we're subscribed to the right room status,
// and we'll switch to the room view model once
// the join is synced
this.navigation.push("room", roomId);
Expand Down
8 changes: 4 additions & 4 deletions src/domain/session/room/timeline/TilesCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ export class TilesCollection extends BaseObservableList {
}
}
// technically we should handle adding a tile here as well
// in case before we didn't have a tile for it but now we do
// in case before we didn't have a tile for it, but now we do
// but in reality we don't have this use case as the type and msgtype
// doesn't change. Decryption maybe is the exception?


// outcomes here can be
// tiles should be removed (got redacted and we don't want it in the timeline)
// tiles should be removed (got redacted, and we don't want it in the timeline)
// tile should be added where there was none before ... ?
// entry should get it's own tile now
// entry should get its own tile now
// merge with neighbours? ... hard to imagine use case for this ...
}

Expand Down Expand Up @@ -277,7 +277,7 @@ export class TilesCollection extends BaseObservableList {
onMove(/*fromIdx, toIdx, value*/) {
// this ... cannot happen in the timeline?
// perhaps we can use this event to support a local echo (in a different fragment)
// to be moved to the key of the remote echo, so we don't loose state ... ?
// to be moved to the key of the remote echo, so we don't lose state ... ?
}

[Symbol.iterator]() {
Expand Down
2 changes: 1 addition & 1 deletion src/domain/session/room/timeline/TimelineViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class TimelineViewModel extends ViewModel {
this._topLoadingPromise = this._timeline.loadAtTop(10).then(hasReachedEnd => {
this._topLoadingPromise = null;
if (!hasReachedEnd) {
// check if more items need to be loaded by recursing
// check if more items need to be loaded with recursion
// use the requested start / end tile,
// so we don't end up overwriting a newly requested visible range here
this.setVisibleTileRange(this._requestedStartTile, this._requestedEndTile);
Expand Down
4 changes: 2 additions & 2 deletions src/domain/session/room/timeline/deserialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class Deserializer {
}

parseTable(node) {
// We are only assuming iterable, so convert to arrary for indexing.
// We are only assuming iterable, so convert to array for indexing.
const children = Array.from(this.result.getChildNodes(node));
let head, body;
if (this._ensureElement(children[0], "THEAD") && this._ensureElement(children[1], "TBODY")) {
Expand Down Expand Up @@ -508,7 +508,7 @@ export async function tests() {
];
assert.deepEqual(parseHTMLBody(platform, null, input), new MessageBody(input, output));
}
/* Doesnt work: HTML library doesn't handle <pre><code> properly.
/* Doesn't work: HTML library doesn't handle <pre><code> properly.
"Text with code block": assert => {
const code = 'main :: IO ()\nmain = putStrLn "Hello"'
const input = `<pre><code>${code}</code></pre>`;
Expand Down
2 changes: 1 addition & 1 deletion src/domain/session/room/timeline/linkify/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ See point 1 below.
const host = `${hostCharacter}*(?=${hostCharacter})${noSpaceNorPunctuation}`;

/*
Use sub groups so we accept just / or #; but if anything comes after it,
Use subgroups, so we accept just / or #; but if anything comes after it,
it should not end with punctuation or space.
*/
const pathOrFragment = `(?:[\\/#](?:[^\\s]*${noSpaceNorPunctuation})?)`;
Expand Down
2 changes: 1 addition & 1 deletion src/domain/session/room/timeline/tiles/BaseMediaTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export class BaseMediaTile extends BaseMessageTile {
const scaleHeightFactor = MAX_HEIGHT / info?.h;
const scaleWidthFactor = MAX_WIDTH / info?.w;
// take the smallest scale factor, to respect all constraints
// we should not upscale images, so limit scale factor to 1 upwards
// we should not upscale images, so limit scale factor to 1
return Math.min(scaleWidthFactor, scaleHeightFactor, 1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/domain/session/room/timeline/tiles/CallTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {avatarInitials, getIdentifierColorNumber, getAvatarHttpUrl} from "../../
// TODO: timeline entries for state events with the same state key and type
// should also update previous entries in the timeline, so we can update the name of the call, whether it is terminated, etc ...

// alternatively, we could just subscribe to the GroupCall and spontanously emit an update when it updates
// alternatively, we could just subscribe to the GroupCall and spontaneously emit an update when it updates

export class CallTile extends SimpleTile {
constructor(entry, options) {
Expand Down
6 changes: 3 additions & 3 deletions src/domain/session/room/timeline/tiles/DateTile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class DateTile extends ViewModel implements ITile<BaseEventEntry> {

/** the entry reference by this datetile, e.g. the entry of the first tile for this day */
private get refEntry(): BaseEventEntry {
// lowerEntry is the first entry... i think?
// lowerEntry is the first entry... I think?
// so given the date header always comes before,
// this is our closest entry.
return this._firstTileInDay.lowerEntry;
Expand Down Expand Up @@ -84,7 +84,7 @@ export class DateTile extends ViewModel implements ITile<BaseEventEntry> {
* used for emitting spontanous updates, but that should also not be
* needed for a DateTile.
* The problem is basically that _findTileIdx maps an entry to
* a tile, and DateTile adopts the entry of it's sibling tile (_firstTileInDay)
* a tile, and DateTile adopts the entry of its sibling tile (_firstTileInDay)
* so now we have the entry pointing to two tiles. So we should avoid
* returning the DateTile itself from the compare method.
* We will always return -1 or 1 from here to signal an entry comes before or after us,
Expand Down Expand Up @@ -130,7 +130,7 @@ export class DateTile extends ViewModel implements ITile<BaseEventEntry> {
// let item know it has a new sibling
updatePreviousSibling(prev: ITile<BaseEntry> | undefined): void {
// forward the sibling update to our next tile, so it is informed
// about it's previous sibling beyond the date header (which is it's direct previous sibling)
// about its previous sibling beyond the date header (which is its direct previous sibling)
// so it can recalculate whether it still needs a date header
this._firstTileInDay.updatePreviousSibling(prev);
}
Expand Down
2 changes: 1 addition & 1 deletion src/domain/session/settings/SettingsViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class SettingsViewModel extends ViewModel {
this._logsFeedbackMessage = this.i18n`Sending logs…`;
try {
await submitLogsFromSessionToDefaultServer(this._session, this.platform);
this._logsFeedbackMessage = this.i18n`Logs sent succesfully!`;
this._logsFeedbackMessage = this.i18n`Logs sent successfully!`;
} catch (err) {
this._logsFeedbackMessage = err.message;
this.emitChange();
Expand Down
2 changes: 1 addition & 1 deletion src/logging/IDBLogPersister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class IDBLogPersister implements ILogReporter {
const itemCount = await reqAsPromise(logs.count());
const limit = this.options.limit ?? 3000;
if (itemCount > limit) {
// delete an extra 10% so we don't need to delete every time we flush
// delete an extra 10%, so we don't need to delete every time we flush
let deleteAmount = (itemCount - limit) + Math.round(0.1 * limit);
await iterateCursor(logs.openCursor(), (_, __, cursor) => {
cursor.delete();
Expand Down
2 changes: 1 addition & 1 deletion src/logging/LogFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class LogFilter {
return false;
}
}
// neither our children or us have a loglevel high enough, filter out.
// neither our children nor us have a loglevel high enough, filter out.
if (this._min !== undefined && !Array.isArray(children) && item.logLevel < this._min) {
return false;
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/logging/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export class Logger implements ILogger {
}

/** Prefer `run()` or `log()` above this method; only use it if you have a long-running operation
* *without* a single call stack that should be logged into one sub-tree.
* You need to call `finish()` on the returned item or it will stay open until the app unloads. */
* *without* a single call stack that should be logged into one subtree.
* You need to call `finish()` on the returned item, or it will stay open until the app unloads. */
child(labelOrValues: LabelOrValues, logLevel: LogLevel = LogLevel.Info, filterCreator?: FilterCreator): ILogItem {
const item = new DeferredPersistRootLogItem(labelOrValues, logLevel, this, filterCreator);
this._openItems.add(item);
Expand Down
2 changes: 1 addition & 1 deletion src/matrix/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export class Client {
this._reconnectSubscription = this._reconnector.connectionStatus.subscribe(state => {
if (state === ConnectionStatus.Online) {
this._platform.logger.runDetached("reconnect", async log => {
// needs to happen before sync and session or it would abort all requests
// needs to happen before sync and session, or it would abort all requests
this._requestScheduler.start();
this._sync.start();
this._sessionStartedByReconnector = true;
Expand Down
4 changes: 2 additions & 2 deletions src/matrix/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ export class Session {
/**
* @internal called from session container when coming back online and catchup syncs have finished.
* @param {Object} lastVersionResponse a response from /versions, which is polled while offline,
* and useful to store so we can later tell what capabilities
* and useful to store, so we can later tell what capabilities
* our homeserver has.
*/
async start(lastVersionResponse, dehydratedDevice, log) {
Expand Down Expand Up @@ -973,7 +973,7 @@ export class Session {
if (!observable) {
let status = undefined;
// Create and set the observable with value = undefined, so that
// we don't loose any sync changes that come in while we are busy
// we don't lose any sync changes that come in while we are busy
// calculating the current room status.
observable = new RetainedObservableValue(status, () => {
this._observedRoomStatus.delete(roomId);
Expand Down
4 changes: 2 additions & 2 deletions src/matrix/Sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class Sync {
} finally {
sessionState.dispose();
}
// sync txn comitted, emit updates and apply changes to in-memory state
// sync txn committed, emit updates and apply changes to in-memory state
log.wrap("after", log => this._afterSync(
sessionState, inviteStates, roomStates, archivedRoomStates, log));

Expand Down Expand Up @@ -253,7 +253,7 @@ export class Sync {
await Promise.all(roomStates.map(async rs => {
const newKeys = newKeysByRoom?.get(rs.room.id);
rs.preparation = await log.wrap("room", async log => {
// if previously joined and we still have the timeline for it,
// if previously joined, and we still have the timeline for it,
// this loads the syncWriter at the correct position to continue writing the timeline
if (rs.isNewRoom) {
await rs.room.load(null, prepareTxn, log);
Expand Down
4 changes: 2 additions & 2 deletions src/matrix/calls/CallHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class CallHandler implements RoomStateHandler {

try {
await call.create(type, log);
// store call info so it will ring again when reopening the app
// store call info, so it will ring again when reopening the app
const txn = await this.options.storage.readWriteTxn([this.options.storage.storeNames.calls]);
txn.calls.add({
intent: call.intent,
Expand Down Expand Up @@ -230,7 +230,7 @@ export class CallHandler implements RoomStateHandler {
txn.calls.remove(call.intent, roomId, call.id);
}
} else if(!event.content["m.terminated"]) {
// We don't have this call already and it isn't terminated, so create the call:
// We don't have this call already, and it isn't terminated, so create the call:
call = new GroupCall(
event.state_key, // id
false, // isLoadedFromStorage
Expand Down
Loading