File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -105,11 +105,11 @@ <h2 class="w3-wide w3-center caps">{{ selectedSupermarket?.name }}</h2>
105
105
</ td >
106
106
< td >
107
107
< span class ="w3-large ">
108
- < a v-if ="!product.isEstimate " v-bind:href ="product.link " target ="_blank " class ="noline " :title ="product.originalQuery ">
108
+ < a v-if ="!product.isEstimate " v-bind:href ="product.link " target ="_blank " class ="noline " :title ="product.originalQuery?.replace(/^x\s/, '') ">
109
109
{{ product.name }}
110
110
</ a >
111
111
< span v-if ="!product.price || product.isEstimate ">
112
- {{product.originalQuery}}
112
+ {{product.originalQuery?.replace(/^x\s/, '') }}
113
113
</ span >
114
114
</ span > < br >
115
115
< span class ="w3-text-blue-gray ">
Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ var app = new Vue(
114
114
this . pricesLastUpdated = checkjebon . pricesLastUpdated ( ) ;
115
115
this . supermarkets = results . map ( s => ( {
116
116
...s ,
117
+ products : s . products . map ( p => {
118
+ p . checked = p . originalQuery . startsWith ( "x " ) ;
119
+ return p ;
120
+ } ) ,
117
121
totalPrice : s . products . reduce ( ( sum , p ) => sum + ( p . price || 0 ) , 0 ) ,
118
122
notFound : s . products . filter ( p => p . isEstimate ) . length
119
123
} ) ) ;
@@ -159,14 +163,14 @@ var app = new Vue(
159
163
} ,
160
164
edit : async function ( product , event , message )
161
165
{
162
- var newProduct = window . prompt ( message , product . originalQuery ) ;
166
+ var newProduct = window . prompt ( message , product . originalQuery ?. replace ( / ^ x \s / , '' ) ) ;
163
167
if ( newProduct )
164
168
{
165
169
this . shoppinglist = this . shoppinglist . split ( "\n" ) . map ( line =>
166
170
{
167
171
if ( line . includes ( product . originalQuery ) )
168
172
{
169
- line = newProduct ;
173
+ line = ( product . originalQuery . startsWith ( "x " ) ? "x " : "" ) + newProduct ;
170
174
}
171
175
return line ;
172
176
} ) . join ( "\n" ) ;
You can’t perform that action at this time.
0 commit comments