correct type issues
This commit is contained in:
@@ -37,6 +37,7 @@ export default class FileTransferModel {
|
||||
};
|
||||
|
||||
readonly prepareToSend = (): void => {
|
||||
if (!this.transferData) return;
|
||||
this.direction = TransferDirections.Send;
|
||||
this.connectionModel.addChannel(this.transferData.channel);
|
||||
};
|
||||
@@ -156,7 +157,7 @@ export default class FileTransferModel {
|
||||
};
|
||||
|
||||
readonly prepareFileForSending = (filePath: string[]): string => {
|
||||
const fileContent: string | undefined =
|
||||
const fileContent: string | null =
|
||||
this.storageModel.read(filePath);
|
||||
if (fileContent == null) return "";
|
||||
|
||||
@@ -168,6 +169,8 @@ export default class FileTransferModel {
|
||||
};
|
||||
|
||||
readonly sendFile = async (stringifiedFileData: string): Promise<void> => {
|
||||
if (!this.transferData) return;
|
||||
|
||||
const encryptedFileData: string = await encryptString(
|
||||
stringifiedFileData,
|
||||
this.transferData.key,
|
||||
|
||||
@@ -6,10 +6,10 @@ export default class SettingsModel {
|
||||
readonly storageModel: StorageModel;
|
||||
|
||||
// data
|
||||
username: string;
|
||||
firstDayOfWeek: string;
|
||||
language: string;
|
||||
theme: string;
|
||||
username: string = "";
|
||||
firstDayOfWeek: string = "";
|
||||
language: string = "";
|
||||
theme: string = "";
|
||||
|
||||
// storage
|
||||
private readonly storeSetting = (
|
||||
@@ -46,7 +46,7 @@ export default class SettingsModel {
|
||||
// load
|
||||
private readonly readSetting = (
|
||||
pathName: keyof typeof filePaths.settingsModel,
|
||||
): string => {
|
||||
): string|null=> {
|
||||
const path = StorageModel.getPath(
|
||||
StorageModelSubPaths.SettingsModel,
|
||||
filePaths.settingsModel[pathName],
|
||||
|
||||
Reference in New Issue
Block a user