Skip to content

Commit

Permalink
fix image upload
Browse files Browse the repository at this point in the history
  • Loading branch information
vivganes committed May 20, 2024
1 parent 977c11c commit 9c06138
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/app/service/ndkprovider.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ export class NdkproviderService {
this.ndk = new NDK({
cacheAdapter: dexieAdapter,
explicitRelayUrls: explicitRelayUrls,
outboxRelayUrls: [ "wss://purplepag.es" ],
enableOutboxModel: true
});
await this.ndk.connect(1000);
Expand Down Expand Up @@ -245,7 +244,6 @@ export class NdkproviderService {
explicitRelayUrls: explicitRelayUrls,
autoConnectUserRelays: true,
autoFetchUserMutelist: true,
outboxRelayUrls: [ "wss://purplepag.es" ],
enableOutboxModel: true
});
await this.ndk.connect(1000);
Expand Down Expand Up @@ -283,7 +281,6 @@ export class NdkproviderService {
explicitRelayUrls: explicitRelayUrls,
autoConnectUserRelays: true,
autoFetchUserMutelist: true,
outboxRelayUrls: [ "wss://purplepag.es" ],
enableOutboxModel: true
};
this.ndk = new NDK(params);
Expand Down Expand Up @@ -378,7 +375,6 @@ export class NdkproviderService {
explicitRelayUrls: relayUrls ? relayUrls : explicitRelayUrls,
autoConnectUserRelays: true,
autoFetchUserMutelist: true,
outboxRelayUrls: [ "wss://purplepag.es" ],
enableOutboxModel: true
};
this.ndk = new NDK(params);
Expand Down Expand Up @@ -420,7 +416,6 @@ export class NdkproviderService {
explicitRelayUrls: relayUrls,
autoConnectUserRelays: true,
autoFetchUserMutelist: true,
outboxRelayUrls: [ "wss://purplepag.es" ],
enableOutboxModel: true
};
const newNDK = new NDK(newNDKParams);
Expand Down Expand Up @@ -553,7 +548,6 @@ export class NdkproviderService {
explicitRelayUrls: relayTags.map((tag) => tag[1]),
autoConnectUserRelays: true,
autoFetchUserMutelist: true,
outboxRelayUrls: [ "wss://purplepag.es" ],
enableOutboxModel: true
})
newNdk.connect(1000).then(()=>{
Expand Down
6 changes: 4 additions & 2 deletions src/app/util/Uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class Uploader {
formData.append('fileToUpload', file);
formData.append('submit', 'Upload');

const response = await fetch('https://nostr.build/api/upload/android.php', {
const response = await fetch('https://nostr.build/api/v2/upload/files', {
headers: {
accept: 'application/json',
},
Expand All @@ -18,12 +18,14 @@ export default class Uploader {
});
if (response.ok) {
const data = await response.json();
console.log(data);
return {
url: new URL(data).toString(),
url: new URL(data.data[0].url).toString(),
};
}
return {
error: 'Upload failed',
};
}

}

0 comments on commit 9c06138

Please sign in to comment.