Skip to content

Commit

Permalink
make sure multiClientAccess defaults to true
Browse files Browse the repository at this point in the history
  • Loading branch information
wds4 committed Jun 11, 2023
1 parent 658b25a commit 70407b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function EnterExternalKeys() {
pubkeyHex,
privkeyHex
);
console.log(`result: ${result}`);
// console.log(`result: ${result}`);

const e = document.getElementById(
'savedKeysGeneratedElsewhereMessageContainer'
Expand Down Expand Up @@ -129,7 +129,7 @@ export default function EnterExternalKeys() {
<div style={{ color: 'red', textAlign: 'center', fontSize: '22px' }}>
CAUTION!
</div>
<div style={{ color: 'red', textAlign: 'left' }}>
<div style={{ color: 'red', textAlign: 'left', fontSize: '16px' }}>
There is a risk this app could introduce errors
into your profile, including loss of your following and relays lists. If you're
going to risk it, I strongly suggest you backup your profile first!
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/window1/lib/nostr/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const generateNewNostrKeys = async (active) => {
const sk = generatePrivateKey(); // `sk` is a hex string
const pk = getPublicKey(sk); // `pk` is a hex string
const currentTime = dateToUnix(new Date());
const sql = `INSERT OR IGNORE INTO myNostrProfile (pubkey, privkey, relays, active, created_at) VALUES ('${pk}', '${sk}', '${JSON.stringify(oDefaultRelayUrls)}', ${active}, ${currentTime}) `;
const sql = `INSERT OR IGNORE INTO myNostrProfile (pubkey, privkey, relays, active, multiClientAccess, created_at) VALUES ('${pk}', '${sk}', '${JSON.stringify(oDefaultRelayUrls)}', ${active}, true, ${currentTime}) `;
await asyncSql(sql);

return [sk, pk];
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/window1/lib/pg/sql/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,15 @@ export const addNewRowToMyNostrProfileInSql = async (pubkey, privkey, name, disp
// pubkey is hex formatted
let sql = "";
if (name && display_name) {
sql = ` INSERT OR IGNORE INTO myNostrProfile (pubkey,privkey,following,relays,active,name,display_name) VALUES ('${pubkey}','${privkey}','[]','${JSON.stringify(
sql = ` INSERT OR IGNORE INTO myNostrProfile (pubkey,privkey,following,relays,active,multiClientAccess,name,display_name) VALUES ('${pubkey}','${privkey}','[]','${JSON.stringify(
oDefaultRelayUrls
)}',false,'${name}','${display_name}') `;
)}',false,true,'${name}','${display_name}') `;
} else {
sql = ` INSERT OR IGNORE INTO myNostrProfile (pubkey,privkey,following,relays,active) VALUES ('${pubkey}','${privkey}','[]','${JSON.stringify(
sql = ` INSERT OR IGNORE INTO myNostrProfile (pubkey,privkey,following,relays,active,multiClientAccess) VALUES ('${pubkey}','${privkey}','[]','${JSON.stringify(
oDefaultRelayUrls
)}',false) `;
)}',false,true) `;
}
console.log(`addNewRowToMyNostrProfileInSql; sql: ${sql}`);
// console.log(`addNewRowToMyNostrProfileInSql; sql: ${sql}`);
// return "foo";
return asyncSql(sql);
};
Expand Down

0 comments on commit 70407b4

Please sign in to comment.