Skip to content

Commit

Permalink
project owner wallet updation
Browse files Browse the repository at this point in the history
  • Loading branch information
ankushKun committed May 22, 2024
1 parent dd9d477 commit 54d3bac
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
15 changes: 9 additions & 6 deletions next_app/src/components/bottom-tab-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export default function BottomTabBar({ collapsed, toggle }: { collapsed: boolean
async function fetchNewInbox() {
if (globalState.activeMode == "WARP") return;
if (!project || !project.process) return;
const ownerWallet = project.ownerWallet;
const activeWallet = await window.arweaveWallet.getActiveAddress();
if (ownerWallet != activeWallet) return;
// console.log("ran");
const cursor = sessionStorage.getItem("cursor") || "";
const r = await getResults(project.process, cursor);
Expand Down Expand Up @@ -96,12 +99,12 @@ export default function BottomTabBar({ collapsed, toggle }: { collapsed: boolean
{ name: "File-Type", value: "Inbox" }
]);
setInbox(JSON.parse(result.Output.data.output).reverse());
const r = await dryrun({
process: pid,
code: "require('json').encode(Inbox)",
tags: [{ name: "Action", value: "Eval" }, { name: "File-Type", value: "Inbox" }],
})
console.log(r)
// const r = await dryrun({
// process: pid,
// code: "return require('json').encode(Inbox)",
// tags: [{ name: "Action", value: "Eval" }, { name: "File-Type", value: "Inbox" }],
// })
// console.log(r)
setLoadingInbox(false);

}
Expand Down
2 changes: 1 addition & 1 deletion next_app/src/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ $$\\int_a^b f'(x) dx = f(b)- f(a)$$`,
return (
<>
{!isNotebook && file && (
<div className="absolute h-10 overflow-clip flex items-center right-10 top-5 z-10 border border-dashed border-btr-grey-1 rounded-full p-0 bg-btr-grey-3">
<div className="absolute h-10 overflow-clip flex items-center right-10 top-5 z-10 border border-dashed rounded-full p-0 bg-accent">
<Button variant="ghost" className="p-1" onClick={runNormalCode}>
<Image
src={running ? Icons.loadingSVG : Icons.runSVG}
Expand Down
5 changes: 3 additions & 2 deletions next_app/src/components/settings-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ export default function SettingsTab() {

async function setProcess() {
const p = manager.getProject(globalState.activeProject);
const activeWallet = await window.arweaveWallet.getActiveAddress();
if (processUsed === "NEW_PROCESS") {
setSpawning(true);
const np = await spawnProcess(newProcessName, [
{ name: "File-Type", value: p.defaultFiletype == "NOTEBOOK" ? "Notebook" : "Normal" }
]);
manager.setProjectProcess(p, np);
manager.setProjectProcess(p, np, activeWallet);
setSpawning(false);
} else {
manager.setProjectProcess(p, processUsed);
manager.setProjectProcess(p, processUsed, activeWallet);
}
setNewProcessName("");
setProcessUsed("");
Expand Down
3 changes: 2 additions & 1 deletion next_app/src/hooks/useProjectManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export class ProjectManager {
return new Project(this.projects[name]);
}

setProjectProcess(proj: Project, processId: string) {
setProjectProcess(proj: Project, processId: string, ownerWallet?: string) {
proj._setProcess(processId);
if (ownerWallet) proj.ownerWallet = ownerWallet;
this.projects[proj.name] = proj;
this.saveProjects(this.projects);
}
Expand Down

0 comments on commit 54d3bac

Please sign in to comment.