lib/atome/kernel/universe.rb in atome-0.5.6.6.9 vs lib/atome/kernel/universe.rb in atome-0.5.6.7.3

- old
+ new

@@ -103,10 +103,11 @@ end def id_to_aid(id, aid) @atomes_ids[id] = aid end + # def update_atome_id(aid, atome, prev_id) # @atomes[id] = atome # @atomes.delete(prev_id) # end # def update_atome_id(id, atome, prev_id) @@ -195,14 +196,12 @@ current_machine_decision(platform, output) # TODO: check the code above and create a sensible identity end def current_server - # Remplacez 'atome' par la valeur correcte pour votre environnement Atome - return unless RUBY_ENGINE.downcase == 'opal' + # return unless RUBY_ENGINE.downcase == 'opal' JS.global[:location][:href].to_s - end def current_user @user end @@ -246,17 +245,19 @@ end def historicize(id, operation, element, params) # if @allow_history && @database_ready - if @allow_history - # A.sync({ action: :historicize, data: { table: :user } }) do |_db_state| - # end + if @allow_history + # A.sync({ action: :historicize, data: { table: :user } }) do |_db_state| + # end operation_timing = Time.now.strftime("%Y%m%d%H%M%S%3N") + @increment.to_s @increment += 1 @increment = @increment % 100 + JS.global[:localStorage].setItem(operation_timing, "{ #{id} => { #{operation} => { #{element} => #{params} } }, sync: false }") @history[@history.length] = { operation_timing => { id => { operation => { element => params } }, sync: false, time: Time.now } } + end end def story @history