Skip to content

Commit

Permalink
Fixed lit template
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Jan 28, 2023
1 parent 81a3152 commit 8ed506d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Task } from '@lit-labs/task';
import '@material/mwc-circular-progress';

import { clientContext } from '../../contexts';
import { {{coordinator_zome_manifest.name}}Signal } from './types';
import { {{pascal_case coordinator_zome_manifest.name}}Signal } from './types';

import './{{kebab_case referenceable.name}}-detail';

Expand Down Expand Up @@ -36,8 +36,8 @@ export class {{pascal_case collection_name}} extends LitElement {
firstUpdated() {
this.client.on('signal', signal => {
if (signal.zome_name !== '{{coordinator_zome_manifest.name}}') return;
const payload = signal.payload as {{coordinator_zome_manifest.name}}Signal;
if (payload.type !== 'EntryCreated')) return;
const payload = signal.payload as {{pascal_case coordinator_zome_manifest.name}}Signal;
if (payload.type !== 'EntryCreated') return;
if (payload.app_entry.type !== '{{pascal_case referenceable.name}}') return;
{{#if (eq collection_type.type "ByAuthor")}}
if (this.author.toString() !== this.client.myPubKey.toString()) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AgentPubKey, EntryHash, ActionHash, Record, AppAgentClient, NewEntryAct
import { consume } from '@lit-labs/context';
import { Task } from '@lit-labs/task';
import { clientContext } from '../../contexts';
import { {{coordinator_zome_manifest.name}}Signal } from './types';
import { {{pascal_case coordinator_zome_manifest.name}}Signal } from './types';

import '@material/mwc-circular-progress';
import './{{kebab_case from_referenceable.name}}-detail';
Expand Down Expand Up @@ -33,7 +33,7 @@ export class {{pascal_case (plural from_referenceable.name)}}For{{pascal_case to
firstUpdated() {
this.client.on('signal', signal => {
if (signal.zome_name !== '{{coordinator_zome_manifest.name}}') return;
const payload = signal.payload as {{coordinator_zome_manifest.name}}Signal;
const payload = signal.payload as {{pascal_case coordinator_zome_manifest.name}}Signal;
if (payload.type !== 'LinkCreated') return;
if (payload.link_type !== '{{pascal_case bidireccional}}') return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '@material/mwc-circular-progress';

import { clientContext } from '../../contexts';
import './{{kebab_case to_referenceable.name}}-detail';
import { {{coordinator_zome_manifest.name}}Signal } from './types';
import { {{pascal_case coordinator_zome_manifest.name}}Signal } from './types';

@customElement('{{kebab_case (plural to_referenceable.name)}}-for-{{kebab_case from_referenceable.name}}')
export class {{pascal_case (plural to_referenceable.name)}}For{{pascal_case from_referenceable.name}} extends LitElement {
Expand All @@ -33,7 +33,7 @@ export class {{pascal_case (plural to_referenceable.name)}}For{{pascal_case from
firstUpdated() {
this.client.on('signal', signal => {
if (signal.zome_name !== '{{coordinator_zome_manifest.name}}') return;
const payload = signal.payload as {{coordinator_zome_manifest.name}}Signal;
const payload = signal.payload as {{pascal_case coordinator_zome_manifest.name}}Signal;
if (payload.type !== 'LinkCreated') return;
if (payload.link_type !== '{{pascal_case link_type_name}}') return;

Expand Down
3 changes: 2 additions & 1 deletion templates/lit/web-app/ui/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"class-methods-use-this": "off",
"@typescript-eslint/no-unused-vars": "off",
"import/no-unresolved": "off",
"import/extensions": "off"
"import/extensions": "off",
"no-use-before-define": "off"
}
},
"prettier": {
Expand Down

0 comments on commit 8ed506d

Please sign in to comment.