forked from trent_larson/crowd-funder-for-time-pwa
fix linting
This commit is contained in:
34
BUILDING.md
34
BUILDING.md
@@ -11,17 +11,6 @@ For a quick dev environment setup, use [pkgx](https://pkgx.dev).
|
||||
- Git
|
||||
- For Android builds: Android Studio with SDK installed
|
||||
- For iOS builds: macOS with Xcode and ruby gems & bundle
|
||||
- `pkgx +rubygems.org sh`
|
||||
|
||||
- ... and you may have to fix these, especially with pkgx
|
||||
|
||||
```bash
|
||||
gem_path=$(which gem)
|
||||
shortened_path="${gem_path:h:h}"
|
||||
export GEM_HOME=$shortened_path
|
||||
export GEM_PATH=$shortened_path
|
||||
```
|
||||
|
||||
- For desktop builds: Additional build tools based on your OS
|
||||
|
||||
## Forks
|
||||
@@ -326,6 +315,24 @@ npm run build:electron-prod && npm run electron:start
|
||||
|
||||
Prerequisites: macOS with Xcode installed
|
||||
|
||||
0. First time (or if XCode dependencies change):
|
||||
|
||||
- `pkgx +rubygems.org sh`
|
||||
|
||||
- ... and you may have to fix these, especially with pkgx
|
||||
|
||||
```bash
|
||||
gem_path=$(which gem)
|
||||
shortened_path="${gem_path:h:h}"
|
||||
export GEM_HOME=$shortened_path
|
||||
export GEM_PATH=$shortened_path
|
||||
```
|
||||
|
||||
```bash
|
||||
cd ios/App
|
||||
pod install
|
||||
```
|
||||
|
||||
1. Build the web assets:
|
||||
|
||||
```bash
|
||||
@@ -334,6 +341,7 @@ Prerequisites: macOS with Xcode installed
|
||||
npm run build:capacitor
|
||||
```
|
||||
|
||||
|
||||
2. Update iOS project with latest build:
|
||||
|
||||
```bash
|
||||
@@ -357,10 +365,10 @@ Prerequisites: macOS with Xcode installed
|
||||
|
||||
```
|
||||
cd ios/App
|
||||
xcrun agvtool new-version 21
|
||||
xcrun agvtool new-version 24
|
||||
# Unfortunately this edits Info.plist directly.
|
||||
#xcrun agvtool new-marketing-version 0.4.5
|
||||
cat App.xcodeproj/project.pbxproj | sed "s/MARKETING_VERSION = .*;/MARKETING_VERSION = 0.4.7;/g" > temp
|
||||
cat App.xcodeproj/project.pbxproj | sed "s/MARKETING_VERSION = .*;/MARKETING_VERSION = 0.5.0;/g" > temp
|
||||
mv temp App.xcodeproj/project.pbxproj
|
||||
cd -
|
||||
```
|
||||
|
||||
@@ -31,8 +31,8 @@ android {
|
||||
applicationId "app.timesafari.app"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 23
|
||||
versionName "0.4.8"
|
||||
versionCode 24
|
||||
versionName "0.5.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
}
|
||||
},
|
||||
"ios": {
|
||||
"contentInset": "always",
|
||||
"contentInset": "never",
|
||||
"allowsLinkPreview": true,
|
||||
"scrollEnabled": true,
|
||||
"limitsNavigationsToAppBoundDomains": true,
|
||||
|
||||
@@ -403,7 +403,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 23;
|
||||
CURRENT_PROJECT_VERSION = 24;
|
||||
DEVELOPMENT_TEAM = GM3FS5JQPH;
|
||||
ENABLE_APP_SANDBOX = NO;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
@@ -413,7 +413,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 0.4.8;
|
||||
MARKETING_VERSION = 0.5.0;
|
||||
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = app.timesafari;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -430,7 +430,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 23;
|
||||
CURRENT_PROJECT_VERSION = 24;
|
||||
DEVELOPMENT_TEAM = GM3FS5JQPH;
|
||||
ENABLE_APP_SANDBOX = NO;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
@@ -440,7 +440,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 0.4.8;
|
||||
MARKETING_VERSION = 0.5.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = app.timesafari;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
|
||||
|
||||
@@ -49,7 +49,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a class="cursor-pointer" @click="$emit('loadClaim', record.jwtId)" data-testid="circle-info-link">
|
||||
<a
|
||||
class="cursor-pointer"
|
||||
data-testid="circle-info-link"
|
||||
@click="$emit('loadClaim', record.jwtId)"
|
||||
>
|
||||
<font-awesome icon="circle-info" class="fa-fw text-slate-500" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -48,10 +48,7 @@
|
||||
<span>
|
||||
{{ didInfo(visDid) }}
|
||||
<span v-if="!serverUtil.isEmptyOrHiddenDid(visDid)">
|
||||
<a
|
||||
:href="`/did/${visDid}`"
|
||||
class="text-blue-500"
|
||||
>
|
||||
<a :href="`/did/${visDid}`" class="text-blue-500">
|
||||
<font-awesome
|
||||
icon="arrow-up-right-from-square"
|
||||
class="fa-fw"
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
</div>
|
||||
</h1>
|
||||
|
||||
The feed underneath this pop-up shows the latest contributions,
|
||||
some from people and some from projects.
|
||||
The feed underneath this pop-up shows the latest contributions, some from
|
||||
people and some from projects.
|
||||
|
||||
<p v-if="isRegistered" class="mt-4">
|
||||
You can now log things that you've seen:
|
||||
@@ -29,8 +29,7 @@
|
||||
button to express your appreciation for... whatever.
|
||||
</p>
|
||||
<p class="mt-4">
|
||||
Once someone registers you, you can log your
|
||||
appreciation, too.
|
||||
Once someone registers you, you can log your appreciation, too.
|
||||
</p>
|
||||
|
||||
<p class="mt-4">
|
||||
|
||||
@@ -8,11 +8,7 @@
|
||||
>
|
||||
<div class="h-full w-full object-contain" v-html="generateIcon()" />
|
||||
</a>
|
||||
<div
|
||||
v-else
|
||||
class="h-full w-full object-contain"
|
||||
v-html="generateIcon()"
|
||||
/>
|
||||
<div v-else class="h-full w-full object-contain" v-html="generateIcon()" />
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { toSvg } from "jdenticon";
|
||||
|
||||
@@ -33,18 +33,18 @@ export const APP_SERVER =
|
||||
|
||||
export const DEFAULT_ENDORSER_API_SERVER =
|
||||
import.meta.env.VITE_DEFAULT_ENDORSER_API_SERVER ||
|
||||
AppString.TEST_ENDORSER_API_SERVER;
|
||||
AppString.PROD_ENDORSER_API_SERVER;
|
||||
|
||||
export const DEFAULT_IMAGE_API_SERVER =
|
||||
import.meta.env.VITE_DEFAULT_IMAGE_API_SERVER ||
|
||||
AppString.TEST_IMAGE_API_SERVER;
|
||||
AppString.PROD_IMAGE_API_SERVER;
|
||||
|
||||
export const DEFAULT_PARTNER_API_SERVER =
|
||||
import.meta.env.VITE_DEFAULT_PARTNER_API_SERVER ||
|
||||
AppString.TEST_PARTNER_API_SERVER;
|
||||
AppString.PROD_PARTNER_API_SERVER;
|
||||
|
||||
export const DEFAULT_PUSH_SERVER =
|
||||
import.meta.env.VITE_DEFAULT_PUSH_SERVER || "https://timesafari.app";
|
||||
import.meta.env.VITE_DEFAULT_PUSH_SERVER || AppString.PROD_PUSH_SERVER;
|
||||
|
||||
export const IMAGE_TYPE_PROFILE = "profile";
|
||||
|
||||
|
||||
@@ -626,7 +626,9 @@ export const retrieveFullyDecryptedAccount = async (
|
||||
return result;
|
||||
};
|
||||
|
||||
export const retrieveAllAccountsMetadata = async (): Promise<AccountEncrypted[]> => {
|
||||
export const retrieveAllAccountsMetadata = async (): Promise<
|
||||
AccountEncrypted[]
|
||||
> => {
|
||||
const platformService = PlatformServiceFactory.getInstance();
|
||||
const dbAccounts = await platformService.dbQuery(`SELECT * FROM accounts`);
|
||||
const accounts = databaseUtil.mapQueryResultToValues(dbAccounts) as Account[];
|
||||
@@ -643,8 +645,12 @@ export const retrieveAllAccountsMetadata = async (): Promise<AccountEncrypted[]>
|
||||
// This is not accurate because they can't be decrypted, but we're removing Dexie anyway.
|
||||
const identityStr = JSON.stringify(identity);
|
||||
const encryptedAccount = {
|
||||
identityEncrBase64: sha256(new TextEncoder().encode(identityStr)).toString(),
|
||||
mnemonicEncrBase64: sha256(new TextEncoder().encode(account.mnemonic)).toString(),
|
||||
identityEncrBase64: sha256(
|
||||
new TextEncoder().encode(identityStr),
|
||||
).toString(),
|
||||
mnemonicEncrBase64: sha256(
|
||||
new TextEncoder().encode(account.mnemonic),
|
||||
).toString(),
|
||||
...metadata,
|
||||
};
|
||||
return encryptedAccount as AccountEncrypted;
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
@click="handleQRCodeClick"
|
||||
>
|
||||
Share Your Info
|
||||
</button>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<section
|
||||
@@ -1015,7 +1015,6 @@ import {
|
||||
retrieveSettingsForActiveAccount,
|
||||
updateAccountSettings,
|
||||
} from "../db/index";
|
||||
import { Account } from "../db/tables/accounts";
|
||||
import { Contact } from "../db/tables/contacts";
|
||||
import {
|
||||
DEFAULT_PASSKEY_EXPIRATION_MINUTES,
|
||||
@@ -1040,7 +1039,6 @@ import {
|
||||
} from "../libs/util";
|
||||
import { UserProfile } from "@/libs/partnerServer";
|
||||
import { logger } from "../utils/logger";
|
||||
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
||||
|
||||
const inputImportFileNameRef = ref<Blob>();
|
||||
|
||||
@@ -1240,7 +1238,6 @@ export default class AccountViewView extends Vue {
|
||||
*/
|
||||
async initializeState() {
|
||||
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||
console.log("settings", settings);
|
||||
if (USE_DEXIE_DB) {
|
||||
await db.open();
|
||||
settings = await retrieveSettingsForActiveAccount();
|
||||
|
||||
@@ -292,10 +292,7 @@
|
||||
<div class="text-sm">
|
||||
{{ didInfo(confirmerId) }}
|
||||
<span v-if="!serverUtil.isEmptyOrHiddenDid(confirmerId)">
|
||||
<a
|
||||
:href="`/did/${confirmerId}`"
|
||||
class="text-blue-500"
|
||||
>
|
||||
<a :href="`/did/${confirmerId}`" class="text-blue-500">
|
||||
<font-awesome
|
||||
icon="arrow-up-right-from-square"
|
||||
class="fa-fw"
|
||||
@@ -332,10 +329,7 @@
|
||||
<div class="text-sm">
|
||||
{{ didInfo(confsVisibleTo) }}
|
||||
<span v-if="!serverUtil.isEmptyOrHiddenDid(confsVisibleTo)">
|
||||
<a
|
||||
:href="`/did/${confsVisibleTo}`"
|
||||
class="text-blue-500"
|
||||
>
|
||||
<a :href="`/did/${confsVisibleTo}`" class="text-blue-500">
|
||||
<font-awesome
|
||||
icon="arrow-up-right-from-square"
|
||||
class="fa-fw"
|
||||
@@ -449,10 +443,7 @@
|
||||
<span>
|
||||
{{ didInfo(visDid) }}
|
||||
<span v-if="!serverUtil.isEmptyOrHiddenDid(visDid)">
|
||||
<a
|
||||
:href="`/did/${visDid}`"
|
||||
class="text-blue-500"
|
||||
>
|
||||
<a :href="`/did/${visDid}`" class="text-blue-500">
|
||||
<font-awesome
|
||||
icon="arrow-up-right-from-square"
|
||||
class="fa-fw"
|
||||
|
||||
@@ -81,7 +81,11 @@ import {
|
||||
} from "../libs/crypto";
|
||||
import { accountsDBPromise, db } from "../db/index";
|
||||
import { MASTER_SETTINGS_KEY } from "../db/tables/settings";
|
||||
import { retrieveAllAccountsMetadata, retrieveFullyDecryptedAccount, saveNewIdentity } from "../libs/util";
|
||||
import {
|
||||
retrieveAllAccountsMetadata,
|
||||
retrieveFullyDecryptedAccount,
|
||||
saveNewIdentity,
|
||||
} from "../libs/util";
|
||||
import { logger } from "../utils/logger";
|
||||
import { Account, AccountEncrypted } from "../db/tables/accounts";
|
||||
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
||||
@@ -100,13 +104,20 @@ export default class ImportAccountView extends Vue {
|
||||
|
||||
async mounted() {
|
||||
const accounts: AccountEncrypted[] = await retrieveAllAccountsMetadata();
|
||||
const decryptedAccounts: (Account | undefined)[] = await Promise.all(accounts.map(async (account) => {
|
||||
return retrieveFullyDecryptedAccount(account.did);
|
||||
}));
|
||||
const filteredDecryptedAccounts: Account[] = decryptedAccounts.filter((account) => account !== undefined);
|
||||
const decryptedAccounts: (Account | undefined)[] = await Promise.all(
|
||||
accounts.map(async (account) => {
|
||||
return retrieveFullyDecryptedAccount(account.did);
|
||||
}),
|
||||
);
|
||||
const filteredDecryptedAccounts: Account[] = decryptedAccounts.filter(
|
||||
(account) => account !== undefined,
|
||||
);
|
||||
|
||||
// group by account.mnemonic
|
||||
const groupedAccounts: Record<string, Account[]> = R.groupBy((a) => a.mnemonic || "", filteredDecryptedAccounts) as Record<string, Account[]>;
|
||||
const groupedAccounts: Record<string, Account[]> = R.groupBy(
|
||||
(a) => a.mnemonic || "",
|
||||
filteredDecryptedAccounts,
|
||||
) as Record<string, Account[]>;
|
||||
|
||||
this.didArrays = groupedAccounts;
|
||||
if (Object.keys(this.didArrays).length > 0) {
|
||||
@@ -125,10 +136,13 @@ export default class ImportAccountView extends Vue {
|
||||
public async incrementDerivation() {
|
||||
// find the maximum derivation path for the selected DIDs
|
||||
const selectedArray: Array<Account> =
|
||||
Object.values(this.didArrays).find((dids) => dids[0].did === this.selectedArrayFirstDid) ||
|
||||
[];
|
||||
Object.values(this.didArrays).find(
|
||||
(dids) => dids[0].did === this.selectedArrayFirstDid,
|
||||
) || [];
|
||||
// extract the derivationPath array and sort it
|
||||
const derivationPaths = selectedArray.map((account) => account.derivationPath);
|
||||
const derivationPaths = selectedArray.map(
|
||||
(account) => account.derivationPath,
|
||||
);
|
||||
derivationPaths.sort((a, b) => {
|
||||
const aParts = a?.split("/");
|
||||
const aLast = aParts?.[aParts.length - 1];
|
||||
@@ -137,7 +151,9 @@ export default class ImportAccountView extends Vue {
|
||||
return parseInt(aLast || "0") - parseInt(bLast || "0");
|
||||
});
|
||||
// we're sure there's at least one
|
||||
const maxDerivPath: string = derivationPaths[derivationPaths.length - 1] as string;
|
||||
const maxDerivPath: string = derivationPaths[
|
||||
derivationPaths.length - 1
|
||||
] as string;
|
||||
|
||||
const newDerivPath = nextDerivationPath(maxDerivPath);
|
||||
|
||||
|
||||
@@ -54,10 +54,7 @@
|
||||
></font-awesome>
|
||||
{{ issuerInfoObject?.displayName }}
|
||||
<span v-if="!serverUtil.isEmptyOrHiddenDid(issuer)">
|
||||
<a
|
||||
:href="`/did/${issuer}`"
|
||||
class="text-blue-500"
|
||||
>
|
||||
<a :href="`/did/${issuer}`" class="text-blue-500">
|
||||
<font-awesome
|
||||
icon="arrow-up-right-from-square"
|
||||
class="fa-fw"
|
||||
|
||||
@@ -230,7 +230,9 @@ export default class QuickActionBvcBeginView extends Vue {
|
||||
suppressMilliseconds: true,
|
||||
}) || "";
|
||||
|
||||
this.allMyDids = (await retrieveAllAccountsMetadata()).map((account) => account.did);
|
||||
this.allMyDids = (await retrieveAllAccountsMetadata()).map(
|
||||
(account) => account.did,
|
||||
);
|
||||
if (USE_DEXIE_DB) {
|
||||
const accountsDB = await accountsDBPromise;
|
||||
await accountsDB.open();
|
||||
|
||||
Reference in New Issue
Block a user